51 lines
1.4 KiB
Diff
51 lines
1.4 KiB
Diff
|
From 77ccf636447cce013f84ee7b7b09f0fe3adcec87 Mon Sep 17 00:00:00 2001
|
||
|
From: Olaf Kirch <okir@suse.de>
|
||
|
Date: Tue, 20 Aug 2013 09:11:45 +0200
|
||
|
Subject: [PATCH 04/13] In init_transport, move creation of COTS sockets
|
||
|
closer to where they are used
|
||
|
|
||
|
Signed-off-by: Olaf Kirch <okir@suse.de>
|
||
|
---
|
||
|
src/rpcbind.c | 18 ++++++------------
|
||
|
1 file changed, 6 insertions(+), 12 deletions(-)
|
||
|
|
||
|
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||
|
index 7ed72bc..f562f7a 100644
|
||
|
--- a/src/rpcbind.c
|
||
|
+++ b/src/rpcbind.c
|
||
|
@@ -309,18 +309,6 @@ init_transport(struct netconfig *nconf)
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
- /*
|
||
|
- * XXX - using RPC library internal functions. For NC_TPI_CLTS
|
||
|
- * we call this later, for each socket we like to bind.
|
||
|
- */
|
||
|
- if (nconf->nc_semantics != NC_TPI_CLTS) {
|
||
|
- if ((fd = __rpc_nconf2fd(nconf)) < 0) {
|
||
|
- syslog(LOG_ERR, "cannot create socket for %s",
|
||
|
- nconf->nc_netid);
|
||
|
- return (1);
|
||
|
- }
|
||
|
- }
|
||
|
-
|
||
|
if (!__rpc_nconf2sockinfo(nconf, &si)) {
|
||
|
syslog(LOG_ERR, "cannot get information for %s",
|
||
|
nconf->nc_netid);
|
||
|
@@ -487,6 +475,12 @@ init_transport(struct netconfig *nconf)
|
||
|
if (!checkbind)
|
||
|
return 1;
|
||
|
} else { /* NC_TPI_COTS */
|
||
|
+ if ((fd = __rpc_nconf2fd(nconf)) < 0) {
|
||
|
+ syslog(LOG_ERR, "cannot create socket for %s",
|
||
|
+ nconf->nc_netid);
|
||
|
+ return (1);
|
||
|
+ }
|
||
|
+
|
||
|
if ((strcmp(nconf->nc_netid, "local") != 0) &&
|
||
|
(strcmp(nconf->nc_netid, "unix") != 0)) {
|
||
|
if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
|
||
|
--
|
||
|
1.7.12.4
|
||
|
|