diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2025-03-24 19:05:48 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2025-03-26 12:17:38 -0400 |
commit | 214c13e380ad7636631279f426387f9c4e3c14d9 (patch) | |
tree | 904cea2e4cdad0fffa24d22d28a04873fbbaa65e /net/sunrpc/rpcb_clnt.c | |
parent | aa42add73ce9b9e3714723d385c254b75814e335 (diff) | |
download | linux-214c13e380ad7636631279f426387f9c4e3c14d9.tar.gz linux-214c13e380ad7636631279f426387f9c4e3c14d9.tar.bz2 linux-214c13e380ad7636631279f426387f9c4e3c14d9.zip |
SUNRPC: rpcbind should never reset the port to the value '0'
If we already had a valid port number for the RPC service, then we
should not allow the rpcbind client to set it to the invalid value '0'.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 102c3818bc54..53bcca365fb1 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -820,9 +820,10 @@ static void rpcb_getport_done(struct rpc_task *child, void *data) } trace_rpcb_setport(child, map->r_status, map->r_port); - xprt->ops->set_port(xprt, map->r_port); - if (map->r_port) + if (map->r_port) { + xprt->ops->set_port(xprt, map->r_port); xprt_set_bound(xprt); + } } /* |