diff options
author | Olaf Kirch <okir@suse.de> | 2015-02-03 11:06:22 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-02-04 08:03:38 -0500 |
commit | 7d5960753eb0b931f8b51118aadd69b8fab955cc (patch) | |
tree | 9ec2dc370408d10fe8bcb3675f48632e5f4d8b30 | |
parent | 08d440ca9de46789163eefc37958e0131fdf9c14 (diff) | |
download | rpcbind-7d5960753eb0b931f8b51118aadd69b8fab955cc.tar.gz |
rpcbind: init_transport cleanup
In init_transport, move creation of COTS sockets
closer to where they are used
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | src/rpcbind.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/rpcbind.c b/src/rpcbind.c index 0c81e8c..e23a957 100644 --- a/src/rpcbind.c +++ b/src/rpcbind.c @@ -425,18 +425,6 @@ init_transport(struct netconfig *nconf) if (my_xprt != NULL) goto got_socket; - /* - * 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 ((strcmp(nconf->nc_netid, "local") == 0) || (strcmp(nconf->nc_netid, "unix") == 0)) { memset(&sun, 0, sizeof sun); @@ -597,6 +585,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) { |