summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-07-02 04:34:54 -0700
committerDave Barach <vpp@barachs.net>2024-07-08 16:27:06 +0000
commit75e8e1e948da182dbf4f6b3394f1b7fc44c1403a (patch)
treef35ad5134743fda3ac732bb5f7d3945e5005ac28 /src/vnet/udp/udp.c
parent6df9f442277603d3ebd3bcf950f7dd0d28fb42f5 (diff)
session: improve enable and disable handling
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c79d16f6a19767d990e8a4683c296219b559ccd
Diffstat (limited to 'src/vnet/udp/udp.c')
-rw-r--r--src/vnet/udp/udp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c
index 9c1121f7cfb..8deeb9e41ee 100644
--- a/src/vnet/udp/udp.c
+++ b/src/vnet/udp/udp.c
@@ -590,6 +590,9 @@ udp_enable_disable (vlib_main_t *vm, u8 is_en)
{
udp_main_t *um = &udp_main;
+ if (!is_en || um->is_init)
+ return 0;
+
/* Not ideal. The sparse vector used to map ports to next nodes assumes
* only a few ports are ever used. When udp transport is enabled this does
* not hold and, to make matters worse, ports are consumed in a random
@@ -610,6 +613,7 @@ udp_enable_disable (vlib_main_t *vm, u8 is_en)
vec_validate (um->transport_ports_refcnt[0], 65535);
vec_validate (um->transport_ports_refcnt[1], 65535);
+ um->is_init = 1;
return 0;
}