Skip to content

Commit

Permalink
SUNRPC: Don't return EPROTONOSUPPORT in svc_register()'s helpers
Browse files Browse the repository at this point in the history
The RPC client returns -EPROTONOSUPPORT if there is a protocol version
mismatch (ie the remote RPC server doesn't support the RPC protocol
version sent by the client).

Helpers for the svc_register() function return -EPROTONOSUPPORT if they
don't recognize the passed-in IPPROTO_ value.

These are two entirely different failure modes.

Have the helpers return -ENOPROTOOPT instead of -EPROTONOSUPPORT.  This
will allow callers to determine more precisely what the underlying
problem is, and decide to report or recover appropriately.

This patch is part of a series that addresses
   http://bugzilla.kernel.org/show_bug.cgi?id=12256

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Mar 28, 2009
1 parent fc28dec commit ba5c35e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ static int __svc_rpcb_register4(const u32 program, const u32 version,
netid = RPCBIND_NETID_TCP;
break;
default:
return -EPROTONOSUPPORT;
return -ENOPROTOOPT;
}

return rpcb_v4_register(program, version,
Expand Down Expand Up @@ -785,7 +785,7 @@ static int __svc_rpcb_register6(const u32 program, const u32 version,
netid = RPCBIND_NETID_TCP6;
break;
default:
return -EPROTONOSUPPORT;
return -ENOPROTOOPT;
}

return rpcb_v4_register(program, version,
Expand Down

0 comments on commit ba5c35e

Please sign in to comment.