aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2012-12-21 15:54:13 +0000
committerKevin Lo <kevlo@FreeBSD.org>2012-12-21 15:54:13 +0000
commita5752d55e0073d71bf3c192bbfab6363960483b5 (patch)
tree978bc55596b12d6142055e42519088a4901b8bba /sbin
parenta443a169067a0eaa714460cdadee2f09d22bc299 (diff)
downloadsrc-a5752d55e0073d71bf3c192bbfab6363960483b5.tar.gz
src-a5752d55e0073d71bf3c192bbfab6363960483b5.zip
Fix socket calls on error post-r243965.
Submitted by: Garrett Cooper
Notes
Notes: svn path=/head/; revision=244538
Diffstat (limited to 'sbin')
-rw-r--r--sbin/hastd/parse.y2
-rw-r--r--sbin/ifconfig/af_nd6.c2
-rw-r--r--sbin/ifconfig/ifconfig.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sbin/hastd/parse.y b/sbin/hastd/parse.y
index a20b61aa1f5a..04ea7ab2513e 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 654e2d97fe0b..80065f6e6153 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 870acdd0445c..983e21fc0401 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);