Commit ffb6ca33 authored by Frank Sorenson's avatar Frank Sorenson Committed by Trond Myklebust

sunrpc: Prevent resvport min/max inversion via sysfs and module parameter

The current min/max resvport settings are independently limited
by the entire range of allowed ports, so max_resvport can be
set to a port lower than min_resvport.

Prevent inversion of min/max values when set through sysfs and
module parameter by setting the limits dependent on each other.
Signed-off-by: default avatarFrank Sorenson <sorenson@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent e08ea3a9
...@@ -3153,8 +3153,12 @@ static int param_set_uint_minmax(const char *val, ...@@ -3153,8 +3153,12 @@ static int param_set_uint_minmax(const char *val,
static int param_set_portnr(const char *val, const struct kernel_param *kp) static int param_set_portnr(const char *val, const struct kernel_param *kp)
{ {
return param_set_uint_minmax(val, kp, if (kp->arg == &xprt_min_resvport)
return param_set_uint_minmax(val, kp,
RPC_MIN_RESVPORT, RPC_MIN_RESVPORT,
xprt_max_resvport);
return param_set_uint_minmax(val, kp,
xprt_min_resvport,
RPC_MAX_RESVPORT); RPC_MAX_RESVPORT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment