diff options
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.c')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index e544332c0b7..31b5a82eae7 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -1672,7 +1672,7 @@ socket_disconnect (rpc_transport_t *this) int -socket_connect (rpc_transport_t *this) +socket_connect (rpc_transport_t *this, int port) { int ret = -1; int sock = -1; @@ -1711,6 +1711,9 @@ socket_connect (rpc_transport_t *this) goto err; } + if (port > 0) + ((struct sockaddr_in *) (&sockaddr))->sin_port = htons (port); + pthread_mutex_lock (&priv->lock); { if (priv->sock != -1) { @@ -2228,7 +2231,7 @@ struct rpc_transport_ops tops = { .get_peername = socket_getpeername, .get_peeraddr = socket_getpeeraddr, .get_myname = socket_getmyname, - .get_myaddr = socket_getmyaddr + .get_myaddr = socket_getmyaddr, }; |