aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2023-10-03 13:54:15 +0200
committerFlorin Coras <florin.coras@gmail.com>2023-10-03 16:28:36 +0000
commite111bbd121b7c2ca4e2a002fd8ed4ffcea5222ff (patch)
tree4c188b2b7a124d4fb92da4609cbd85e897977070 /src/vnet/session/session.c
parentbc37878ecbad0a3a24801f1ad5af04a209b4c201 (diff)
session: make port range configurable
Type: feature This patch makes the port range used by the transport layer configurable in the manner of sysctl's ip_local_port_range. Change-Id: Ie17f776538311b29d1dca64643a3a0bd74cb90a6 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 1f73eefd773..23c58ef2d89 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -2171,6 +2171,8 @@ session_main_init (vlib_main_t * vm)
smm->use_private_rx_mqs = 0;
smm->no_adaptive = 0;
smm->last_transport_proto_type = TRANSPORT_PROTO_HTTP;
+ smm->port_allocator_min_src_port = 1024;
+ smm->port_allocator_max_src_port = 65535;
return 0;
}
@@ -2268,6 +2270,10 @@ session_config_fn (vlib_main_t * vm, unformat_input_t * input)
else if (unformat (input, "local-endpoints-table-buckets %d",
&smm->local_endpoints_table_buckets))
;
+ else if (unformat (input, "min-src-port %d", &tmp))
+ smm->port_allocator_min_src_port = tmp;
+ else if (unformat (input, "max-src-port %d", &tmp))
+ smm->port_allocator_max_src_port = tmp;
else if (unformat (input, "enable"))
smm->session_enable_asap = 1;
else if (unformat (input, "use-app-socket-api"))