]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
getport: Convert TCP connection refused to RPC_CANTRECV
authorChuck Lever <chuck.lever@oracle.com>
Tue, 14 Jul 2009 20:27:54 +0000 (16:27 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 14 Jul 2009 20:27:54 +0000 (16:27 -0400)
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 <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/getport.c

index e39f809973d84c2e9dc676c1f69ba4eb740b17fb..f5ba4ef7c585e24c8e5730ae8ce9f43936823102 100644 (file)
@@ -79,6 +79,9 @@ nfs_gp_map_tcp_errorcodes(const unsigned short protocol)
        case ETIMEDOUT:
                rpc_createerr.cf_stat = RPC_TIMEDOUT;
                break;
        case ETIMEDOUT:
                rpc_createerr.cf_stat = RPC_TIMEDOUT;
                break;
+       case ECONNREFUSED:
+               rpc_createerr.cf_stat = RPC_CANTRECV;
+               break;
        }
 }
 
        }
 }