Skip to content

Commit 214c13e

Browse files
author
Trond Myklebust
committed
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>
1 parent aa42add commit 214c13e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/sunrpc/rpcb_clnt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,10 @@ static void rpcb_getport_done(struct rpc_task *child, void *data)
820820
}
821821

822822
trace_rpcb_setport(child, map->r_status, map->r_port);
823-
xprt->ops->set_port(xprt, map->r_port);
824-
if (map->r_port)
823+
if (map->r_port) {
824+
xprt->ops->set_port(xprt, map->r_port);
825825
xprt_set_bound(xprt);
826+
}
826827
}
827828

828829
/*

0 commit comments

Comments
 (0)