summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-12-21 15:54:13 +0000
committerkevlo <kevlo@FreeBSD.org>2012-12-21 15:54:13 +0000
commit804c67a4867afb8b7ef41a3ade748cab870b788c (patch)
tree978bc55596b12d6142055e42519088a4901b8bba
parent6547dbdbaff0d10e29457c19876b28de348a0643 (diff)
downloadFreeBSD-src-804c67a4867afb8b7ef41a3ade748cab870b788c.zip
FreeBSD-src-804c67a4867afb8b7ef41a3ade748cab870b788c.tar.gz
Fix socket calls on error post-r243965.
Submitted by: Garrett Cooper
-rw-r--r--bin/date/netdate.c2
-rw-r--r--lib/libnetgraph/sock.c4
-rw-r--r--sbin/hastd/parse.y2
-rw-r--r--sbin/ifconfig/af_nd6.c2
-rw-r--r--sbin/ifconfig/ifconfig.c2
-rw-r--r--usr.sbin/mountd/mountd.c2
-rw-r--r--usr.sbin/mtest/mtest.c4
-rw-r--r--usr.sbin/rpcbind/rpcbind.c4
-rw-r--r--usr.sbin/ypserv/yp_main.c2
9 files changed, 12 insertions, 12 deletions
diff --git a/bin/date/netdate.c b/bin/date/netdate.c
index b085be4..e506e6d 100644
--- a/bin/date/netdate.c
+++ b/bin/date/netdate.c
@@ -85,7 +85,7 @@ netsettime(time_t tval)
dest.sin_addr.s_addr = htonl((u_long)INADDR_ANY);
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
- if (errno != EPROTONOSUPPORT)
+ if (errno != EAFNOSUPPORT)
warn("timed");
return (retval = 2);
}
diff --git a/lib/libnetgraph/sock.c b/lib/libnetgraph/sock.c
index fca3900..5f9f563 100644
--- a/lib/libnetgraph/sock.c
+++ b/lib/libnetgraph/sock.c
@@ -71,10 +71,10 @@ NgMkSockNode(const char *name, int *csp, int *dsp)
name = NULL;
/* Create control socket; this also creates the netgraph node.
- If we get an EPROTONOSUPPORT then the socket node type is
+ If we get an EAFNOSUPPORT then the socket node type is
not loaded, so load it and try again. */
if ((cs = socket(AF_NETGRAPH, SOCK_DGRAM, NG_CONTROL)) < 0) {
- if (errno == EPROTONOSUPPORT) {
+ if (errno == EAFNOSUPPORT) {
if (kldload(NG_SOCKET_KLD) < 0) {
errnosv = errno;
if (_gNgDebugLevel >= 1)
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);
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 543fc14..bc290d6 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -649,7 +649,7 @@ create_service(struct netconfig *nconf)
*/
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
int non_fatal = 0;
- if (errno == EPROTONOSUPPORT &&
+ if (errno == EAFNOSUPPORT &&
nconf->nc_semantics != NC_TPI_CLTS)
non_fatal = 1;
diff --git a/usr.sbin/mtest/mtest.c b/usr.sbin/mtest/mtest.c
index 60f7e09..a28fab7 100644
--- a/usr.sbin/mtest/mtest.c
+++ b/usr.sbin/mtest/mtest.c
@@ -204,12 +204,12 @@ main(int argc, char **argv)
s6 = -1;
#ifdef INET
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if (s == -1 && errno != EPROTONOSUPPORT)
+ if (s == -1 && errno != EAFNOSUPPORT)
err(1, "can't open IPv4 socket");
#endif
#ifdef INET6
s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
- if (s6 == -1 && errno != EPROTONOSUPPORT)
+ if (s6 == -1 && errno != EAFNOSUPPORT)
err(1, "can't open IPv6 socket");
#endif
if (s == -1 && s6 == -1)
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
index 3d11af1..fb6c99d 100644
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -289,7 +289,7 @@ init_transport(struct netconfig *nconf)
*/
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
int non_fatal = 0;
- if (errno == EPROTONOSUPPORT)
+ if (errno == EAFNOSUPPORT)
non_fatal = 1;
syslog(non_fatal?LOG_DEBUG:LOG_ERR, "cannot create socket for %s",
nconf->nc_netid);
@@ -352,7 +352,7 @@ init_transport(struct netconfig *nconf)
*/
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
int non_fatal = 0;
- if (errno == EPROTONOSUPPORT &&
+ if (errno == EAFNOSUPPORT &&
nconf->nc_semantics != NC_TPI_CLTS)
non_fatal = 1;
syslog(non_fatal ? LOG_DEBUG : LOG_ERR,
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c
index 69dae29..60bd6a1 100644
--- a/usr.sbin/ypserv/yp_main.c
+++ b/usr.sbin/ypserv/yp_main.c
@@ -292,7 +292,7 @@ create_service(const int sock, const struct netconfig *nconf,
s = __rpc_nconf2fd(nconf);
if (s < 0) {
- if (errno == EPROTONOSUPPORT)
+ if (errno == EAFNOSUPPORT)
_msgout("unsupported"
" transport: %s",
nconf->nc_netid);
OpenPOWER on IntegriCloud