X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fnfs%2Frpcmisc.c;h=457d642558c2c705ac0ea97a9d0a594ed5b536d1;hb=1c290a9551affd855cab3b246f9f893e2072f34b;hp=b994fb1361fd19e25e4296446ee128e2feccaaf2;hpb=6a66bb69d8fdb43f0abb58fd74566461f0e96633;p=nfs-utils.git diff --git a/support/nfs/rpcmisc.c b/support/nfs/rpcmisc.c index b994fb1..457d642 100644 --- a/support/nfs/rpcmisc.c +++ b/support/nfs/rpcmisc.c @@ -67,8 +67,9 @@ rpc_init(char *name, int prog, int vers, void (*dispatch)(), int defport, if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_DGRAM)) { static SVCXPRT *last_transp = NULL; - if (_rpcfdtype == 0 && defport != 0) { - if (last_transp && last_transp->xp_port == defport) { + if (_rpcfdtype == 0) { + if (last_transp + && (!defport || defport == last_transp->xp_port)) { transp = last_transp; goto udp_transport; } @@ -92,8 +93,9 @@ rpc_init(char *name, int prog, int vers, void (*dispatch)(), int defport, if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_STREAM)) { static SVCXPRT *last_transp = NULL; - if (_rpcfdtype == 0 && defport != 0) { - if (last_transp && last_transp->xp_port == defport) { + if (_rpcfdtype == 0) { + if (last_transp + && (!defport || defport == last_transp->xp_port)) { transp = last_transp; goto tcp_transport; }