From: Chuck Lever Date: Tue, 14 Jul 2009 20:27:54 +0000 (-0400) Subject: getport: Convert TCP connection refused to RPC_CANTRECV X-Git-Tag: nfs-utils-1-2-1-rc2~19 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=682a9855b93a7d3545a26eea39a0895b9757cdcb;p=nfs-utils.git getport: Convert TCP connection refused to RPC_CANTRECV In a similar vein to the timeout logic we just restored, a refused TCP connection should be mapped to an equivalent UDP error code: RPC_CANTRECV. This is new behavior for TCP connections; the legacy mount command appears to have simply failed immediately if a TCP connection was refused during an rpcbind query. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- diff --git a/support/nfs/getport.c b/support/nfs/getport.c index e39f809..f5ba4ef 100644 --- a/support/nfs/getport.c +++ b/support/nfs/getport.c @@ -79,6 +79,9 @@ nfs_gp_map_tcp_errorcodes(const unsigned short protocol) case ETIMEDOUT: rpc_createerr.cf_stat = RPC_TIMEDOUT; break; + case ECONNREFUSED: + rpc_createerr.cf_stat = RPC_CANTRECV; + break; } }