libtirpc/0001-update-libtirpc-to-enable-tcp-port-listening.patch

38 lines
1005 B
Diff
Raw Normal View History

2019-09-30 10:58:31 -04:00
From ce60a0505a473a9462af9af40425c9c3400e7385 Mon Sep 17 00:00:00 2001
Date: Thu, 4 Apr 2019 05:30:15 +0000
Subject: [PATCH] libtirp: update libtirpc to enable tcp port listening
Change-Id: I1f0b4d12fb80158c50026f76d5c6a5cafb7038e7
---
src/rpc_soc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/rpc_soc.c b/src/rpc_soc.c
index 5a6eeb7..bf27673 100644
--- a/src/rpc_soc.c
+++ b/src/rpc_soc.c
@@ -314,6 +314,8 @@ svc_com_create(fd, sendsize, recvsize, netid)
int madefd = FALSE;
int port;
+ struct sockaddr_in sin;
+
if ((nconf = __rpc_getconfip(netid)) == NULL) {
(void) syslog(LOG_ERR, "Could not get %s transport", netid);
return (NULL);
@@ -329,6 +331,11 @@ svc_com_create(fd, sendsize, recvsize, netid)
madefd = TRUE;
}
+ memset(&sin, 0, sizeof sin);
+ sin.sin_family = AF_INET;
+ bindresvport(fd, &sin);
+ listen(fd, SOMAXCONN);
+
svc = svc_tli_create(fd, nconf, NULL, sendsize, recvsize);
(void) freenetconfigent(nconf);
if (svc == NULL) {
--
1.8.3.1