summaryrefslogtreecommitdiff
path: root/net/sctp/sysctl.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2020-10-29 15:05:01 +0800
committerJakub Kicinski <kuba@kernel.org>2020-10-30 15:24:06 -0700
commite8a3001c2120c760017da81a307308572a3cdbbc (patch)
treea6770ee9418f7523fb534ced95ed9204ed1c2880 /net/sctp/sysctl.c
parent89ba49171fb22c130be4786d5ada9dda33dd7801 (diff)
sctp: add encap_port for netns sock asoc and transport
encap_port is added as per netns/sock/assoc/transport, and the latter one's encap_port inherits the former one's by default. The transport's encap_port value would mostly decide if one packet should go out with udp encapsulated or not. This patch also allows users to set netns' encap_port by sysctl. v1->v2: - Change to define encap_port as __be16 for sctp_sock, asoc and transport. v2->v3: - No change. v3->v4: - Add 'encap_port' entry in ip-sysctl.rst. v4->v5: - Improve the description of encap_port in ip-sysctl.rst. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sctp/sysctl.c')
-rw-r--r--net/sctp/sysctl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index c16c80963e55..ecc1b5e4c297 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -36,6 +36,7 @@ static int rto_alpha_max = 1000;
static int rto_beta_max = 1000;
static int pf_expose_max = SCTP_PF_EXPOSE_MAX;
static int ps_retrans_max = SCTP_PS_RETRANS_MAX;
+static int udp_port_max = 65535;
static unsigned long max_autoclose_min = 0;
static unsigned long max_autoclose_max =
@@ -291,6 +292,15 @@ static struct ctl_table sctp_net_table[] = {
.proc_handler = proc_dointvec,
},
{
+ .procname = "encap_port",
+ .data = &init_net.sctp.encap_port,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = &udp_port_max,
+ },
+ {
.procname = "addr_scope_policy",
.data = &init_net.sctp.scope_policy,
.maxlen = sizeof(int),