1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Don't allow opt.ipv4_only and opt.ipv6_only to both be set.

This commit is contained in:
hniksic 2003-11-15 16:31:58 -08:00
parent dcc890b007
commit 66cc6d43f6
3 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,11 @@
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

View File

@ -321,7 +321,8 @@ defaults (void)
{
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);
}

View File

@ -806,6 +806,18 @@ Can't timestamp and not clobber old files at the same time.\n"));
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)
{