Disable ipv6 when getnetconfigent("udp6"/"tcp6") fails.

Submitted by: Martin Blapp <mb@imp.ch>
This commit is contained in:
Alfred Perlstein 2001-03-25 23:28:03 +00:00
parent 5d8a28f3e1
commit 69444aa31b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74799
2 changed files with 4 additions and 2 deletions

View File

@ -256,7 +256,8 @@ main(argc, argv, envp)
ip6flag = 1;
s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (s < 0 && (errno == EPROTONOSUPPORT ||
errno == EPFNOSUPPORT || errno == EAFNOSUPPORT))
errno == EPFNOSUPPORT || errno == EAFNOSUPPORT) ||
(getnetconfigent("udp6") == NULL && getnetconfigent("tcp6") == NULL))
ip6flag = 0;
else
close(s);

View File

@ -256,7 +256,8 @@ main(argc, argv, envp)
ip6flag = 1;
s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (s < 0 && (errno == EPROTONOSUPPORT ||
errno == EPFNOSUPPORT || errno == EAFNOSUPPORT))
errno == EPFNOSUPPORT || errno == EAFNOSUPPORT) ||
(getnetconfigent("udp6") == NULL && getnetconfigent("tcp6") == NULL))
ip6flag = 0;
else
close(s);