diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-12-21 15:54:13 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-12-21 15:54:13 +0000 |
commit | 804c67a4867afb8b7ef41a3ade748cab870b788c (patch) | |
tree | 978bc55596b12d6142055e42519088a4901b8bba /sbin | |
parent | 6547dbdbaff0d10e29457c19876b28de348a0643 (diff) | |
download | FreeBSD-src-804c67a4867afb8b7ef41a3ade748cab870b788c.zip FreeBSD-src-804c67a4867afb8b7ef41a3ade748cab870b788c.tar.gz |
Fix socket calls on error post-r243965.
Submitted by: Garrett Cooper
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/hastd/parse.y | 2 | ||||
-rw-r--r-- | sbin/ifconfig/af_nd6.c | 2 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sbin/hastd/parse.y b/sbin/hastd/parse.y index a20b61a..04ea7ab 100644 --- a/sbin/hastd/parse.y +++ b/sbin/hastd/parse.y @@ -769,7 +769,7 @@ family_supported(int family) int sock; sock = socket(family, SOCK_STREAM, 0); - if (sock == -1 && errno == EPROTONOSUPPORT) + if (sock == -1 && errno == EAFNOSUPPORT) return (false); if (sock >= 0) (void)close(sock); diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c index 654e2d9..80065f6 100644 --- a/sbin/ifconfig/af_nd6.c +++ b/sbin/ifconfig/af_nd6.c @@ -148,7 +148,7 @@ nd6_status(int s) memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - if (errno != EPROTONOSUPPORT) + if (errno != EAFNOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); return; } diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 870acdd..983e21f 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -520,7 +520,7 @@ top: AF_LOCAL : afp->af_af; if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 && - (uafp != NULL || errno != EPROTONOSUPPORT || + (uafp != NULL || errno != EAFNOSUPPORT || (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)) err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family); |