Skip to contentSkip to conversation

nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c

PATCH In review Chuck Lever 1 participant 2 messages Apr 29, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c

Use the correct #ifdef variable to enable IPv6 support for privileged RPC clients. Without this fix, unmounting IPv6 NFSv2/v3 servers fails.

Introduced by commit 8c94296bc84f3a204f2061c0391a1d2350e4f37e.

---

 support/nfs/rpc_socket.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
support/nfs/rpc_socket.c +5 -7
index 85e6064..cebf83d 100644
@@ -132,7 +132,7 @@ static int nfs_bind(const int sock, const sa_family_t family)
 	return -1;
 }
 
-#ifdef IPV6_SUPPORT
+#ifdef IPV6_SUPPORTED
 
 /*
  * Bind a socket using an unused privileged source port.
@@ -153,18 +153,16 @@ static int nfs_bindresvport(const int sock, const sa_family_t family)
 
 	switch (family) {
 	case AF_INET:
-		return bindresvport_sa(sock, (struct sockaddr *)&sin,
-					(socklen_t)sizeof(sin));
+		return bindresvport_sa(sock, (struct sockaddr *)&sin);
 	case AF_INET6:
-		return bindresvport_sa(sock, (struct sockaddr *)&sin6,
-					(socklen_t)sizeof(sin6));
+		return bindresvport_sa(sock, (struct sockaddr *)&sin6);
 	}
 
 	errno = EAFNOSUPPORT;
 	return -1;
 }
 
-#else	/* !IPV6_SUPPORT */
+#else	/* !IPV6_SUPPORTED */
 
 /*
  * Bind a socket using an unused privileged source port.
@@ -182,7 +180,7 @@ static int nfs_bindresvport(const int sock, const sa_family_t family)
 	return bindresvport(sock, NULL);
 }
 
-#endif	/* !IPV6_SUPPORT */
+#endif	/* !IPV6_SUPPORTED */
 
 /*
  * Perform a non-blocking connect on the socket fd.

A message that is not in the archive (sent off-list or not yet received): 20090429212247.9359.84751.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org

#2 lore raw

Sorry, you can ignore this one.

Quoted 59 lines · Chuck Lever

Use the correct #ifdef variable to enable IPv6 support for privileged RPC clients. Without this fix, unmounting IPv6 NFSv2/v3 servers fails.

Introduced by commit 8c94296bc84f3a204f2061c0391a1d2350e4f37e.

---

support/nfs/rpc_socket.c | 12 +++++-------

1 files changed, 5 insertions(+), 7 deletions(-)
support/nfs/rpc_socket.c +1 -1
index 85e6064..cebf83d 100644
@@ -132,7 +132,7 @@ static int nfs_bind(const int sock, const  
 sa_family_t family)
 	return -1;
 }
 
-#ifdef IPV6_SUPPORT
+#ifdef IPV6_SUPPORTED
 
 /*

* Bind a socket using an unused privileged source port.

support/nfs/rpc_socket.c +3 -5
@@ -153,18 +153,16 @@ static int nfs_bindresvport(const int sock,  
 const sa_family_t family)
 
 	switch (family) {
 	case AF_INET:
-		return bindresvport_sa(sock, (struct sockaddr *)&sin,
-					(socklen_t)sizeof(sin));
+		return bindresvport_sa(sock, (struct sockaddr *)&sin);
 	case AF_INET6:
-		return bindresvport_sa(sock, (struct sockaddr *)&sin6,
-					(socklen_t)sizeof(sin6));
+		return bindresvport_sa(sock, (struct sockaddr *)&sin6);
 	}
 
 	errno = EAFNOSUPPORT;
 	return -1;
 }
 
-#else	/* !IPV6_SUPPORT */
+#else	/* !IPV6_SUPPORTED */
 
 /*

* Bind a socket using an unused privileged source port.

support/nfs/rpc_socket.c +1 -1
@@ -182,7 +180,7 @@ static int nfs_bindresvport(const int sock,  
 const sa_family_t family)
 	return bindresvport(sock, NULL);
 }
 
-#endif	/* !IPV6_SUPPORT */
+#endif	/* !IPV6_SUPPORTED */
 
 /*

* Perform a non-blocking connect on the socket fd.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com