Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2012 15:54:14 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244538 - in head: bin/date lib/libnetgraph sbin/hastd sbin/ifconfig usr.sbin/mountd usr.sbin/mtest usr.sbin/rpcbind usr.sbin/ypserv
Message-ID:  <201212211554.qBLFsE2P090506@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Fri Dec 21 15:54:13 2012
New Revision: 244538
URL: http://svnweb.freebsd.org/changeset/base/244538

Log:
  Fix socket calls on error post-r243965.
  
  Submitted by:	Garrett Cooper

Modified:
  head/bin/date/netdate.c
  head/lib/libnetgraph/sock.c
  head/sbin/hastd/parse.y
  head/sbin/ifconfig/af_nd6.c
  head/sbin/ifconfig/ifconfig.c
  head/usr.sbin/mountd/mountd.c
  head/usr.sbin/mtest/mtest.c
  head/usr.sbin/rpcbind/rpcbind.c
  head/usr.sbin/ypserv/yp_main.c

Modified: head/bin/date/netdate.c
==============================================================================
--- head/bin/date/netdate.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/bin/date/netdate.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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);
 	}

Modified: head/lib/libnetgraph/sock.c
==============================================================================
--- head/lib/libnetgraph/sock.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/lib/libnetgraph/sock.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -71,10 +71,10 @@ NgMkSockNode(const char *name, int *csp,
 		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)

Modified: head/sbin/hastd/parse.y
==============================================================================
--- head/sbin/hastd/parse.y	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/sbin/hastd/parse.y	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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);

Modified: head/sbin/ifconfig/af_nd6.c
==============================================================================
--- head/sbin/ifconfig/af_nd6.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/sbin/ifconfig/af_nd6.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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;
 	}

Modified: head/sbin/ifconfig/ifconfig.c
==============================================================================
--- head/sbin/ifconfig/ifconfig.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/sbin/ifconfig/ifconfig.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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);
 

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/usr.sbin/mountd/mountd.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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;
 				

Modified: head/usr.sbin/mtest/mtest.c
==============================================================================
--- head/usr.sbin/mtest/mtest.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/usr.sbin/mtest/mtest.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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)

Modified: head/usr.sbin/rpcbind/rpcbind.c
==============================================================================
--- head/usr.sbin/rpcbind/rpcbind.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/usr.sbin/rpcbind/rpcbind.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -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, 

Modified: head/usr.sbin/ypserv/yp_main.c
==============================================================================
--- head/usr.sbin/ypserv/yp_main.c	Fri Dec 21 15:15:35 2012	(r244537)
+++ head/usr.sbin/ypserv/yp_main.c	Fri Dec 21 15:54:13 2012	(r244538)
@@ -292,7 +292,7 @@ create_service(const int sock, const str
 
 				s = __rpc_nconf2fd(nconf);
 				if (s < 0) {
-					if (errno == EPROTONOSUPPORT)
+					if (errno == EAFNOSUPPORT)
 						_msgout("unsupported"
 						    " transport: %s",
 						    nconf->nc_netid);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212211554.qBLFsE2P090506>