+2003-11-16 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * main.c (main): Don't allow setting of both opt.ipv4_only and
+ opt.ipv6_only.
+
+ * init.c (defaults): Mark opt.ipv4_only specially when set
+ automatically.
+
2003-11-15 Hrvoje Niksic <hniksic@xemacs.org>
* host.c (lookup_host): Use AI_ADDRCONFIG only if the family is
{
int sock = socket (AF_INET6, SOCK_STREAM, 0);
if (sock < 0)
- opt.ipv4_only = 1;
+ opt.ipv4_only = -1; /* special value -1 because the option
+ was not specified by the user. */
else
close (sock);
}
print_usage ();
exit (1);
}
+ if (opt.ipv4_only && opt.ipv6_only)
+ {
+ if (opt.ipv4_only == -1)
+ /* ipv4_only was set automatically because the system doesn't
+ support IPv6. */
+ printf (_("Cannot use --inet6-only on a system without IPv6 support.\n"));
+ else
+ printf (_("Cannot specify both --inet4-only and --inet6-only.\n"));
+ print_usage ();
+ exit (1);
+ }
+
nurl = argc - optind;
if (!nurl && !opt.input_filename)
{