linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Restore using reserve ports for client connections
@ 2018-04-10 21:30 Steve Dickson
  2018-04-10 21:30 ` [PATCH 2/2] Restore creating listening connection to server connections Steve Dickson
  2018-04-10 22:17 ` [Libtirpc-devel] [PATCH 1/2] Restore using reserve ports for client connections Chuck Lever
  0 siblings, 2 replies; 10+ messages in thread
From: Steve Dickson @ 2018-04-10 21:30 UTC (permalink / raw)
  To: Libtirpc-devel Mailing List; +Cc: Linux NFS Mailing list

Commit 46e04a73 changed both clnt_com_create()
and clnt_tli_create() to avoid using reserve ports when
creating connection to the server.

For certain legacy apps, the client has to used
reserve port to be able to communicate with its
server so using of reserve ports is restored.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/clnt_generic.c | 3 +--
 src/rpc_soc.c      | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/clnt_generic.c b/src/clnt_generic.c
index e5a314f..774292b 100644
--- a/src/clnt_generic.c
+++ b/src/clnt_generic.c
@@ -341,8 +341,7 @@ clnt_tli_create(int fd, const struct netconfig *nconf,
 		servtype = nconf->nc_semantics;
 		if (!__rpc_fd2sockinfo(fd, &si))
 			goto err;
-		if (__binddynport(fd) == -1)
-			goto err;
+		bindresvport(fd, NULL);
 	} else {
 		if (!__rpc_fd2sockinfo(fd, &si))
 			goto err;
diff --git a/src/rpc_soc.c b/src/rpc_soc.c
index af6c482..f32a27c 100644
--- a/src/rpc_soc.c
+++ b/src/rpc_soc.c
@@ -147,8 +147,7 @@ clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp, flags)
 	bindaddr.maxlen = bindaddr.len =  sizeof (struct sockaddr_in);
 	bindaddr.buf = raddr;
 
-	if (__binddynport(fd) == -1)
-		goto err;
+	bindresvport(fd, NULL);
 	cl = clnt_tli_create(fd, nconf, &bindaddr, prog, vers,
 				sendsz, recvsz);
 	if (cl) {
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-11 14:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-10 21:30 [PATCH 1/2] Restore using reserve ports for client connections Steve Dickson
2018-04-10 21:30 ` [PATCH 2/2] Restore creating listening connection to server connections Steve Dickson
2018-04-10 22:29   ` Chuck Lever
2018-04-11 13:39     ` Steve Dickson
2018-04-10 22:17 ` [Libtirpc-devel] [PATCH 1/2] Restore using reserve ports for client connections Chuck Lever
2018-04-11 12:34   ` Steve Dickson
2018-04-11 12:59     ` Thorsten Kukuk
2018-04-11 14:07       ` Steve Dickson
2018-04-11 14:09         ` Chuck Lever
2018-04-11 14:09     ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).