]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sctp: fix the proc_handler for sysctl encap_port
authorXin Long <lucien.xin@gmail.com>
Tue, 25 May 2021 02:49:42 +0000 (22:49 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 May 2021 22:18:29 +0000 (15:18 -0700)
proc_dointvec() cannot do min and max check for setting a value
when extra1/extra2 is set, so change it to proc_dointvec_minmax()
for sysctl encap_port.

Fixes: e8a3001c2120 ("sctp: add encap_port for netns sock asoc and transport")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sysctl.c

index e92df779af73381351b6521910bcd8e79e6df715..55871b277f475e8068692015f4a67ce1ce111c00 100644 (file)
@@ -307,7 +307,7 @@ static struct ctl_table sctp_net_table[] = {
                .data           = &init_net.sctp.encap_port,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = SYSCTL_ZERO,
                .extra2         = &udp_port_max,
        },