From 37127f7bcc468ebe68936362c2a4e086b25bf202 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Sat, 17 Feb 2024 11:45:25 -0800 Subject: udp: use transport port refcnt on accept Use udp transport refcnt instead of local port refcnt when accepting new connections. Type: fix Signed-off-by: Florin Coras Change-Id: Ibc34677b1138682497f98e96b6fddb5b96094ff9 --- src/vnet/udp/udp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/vnet/udp/udp.c') diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c index e194b9cc643..0a0247a5ef4 100644 --- a/src/vnet/udp/udp.c +++ b/src/vnet/udp/udp.c @@ -43,6 +43,14 @@ udp_connection_register_port (u16 lcl_port, u8 is_ip4) __ATOMIC_RELAXED); } +void +udp_connection_share_port (u16 lcl_port, u8 is_ip4) +{ + udp_main_t *um = &udp_main; + __atomic_add_fetch (&um->transport_ports_refcnt[is_ip4][lcl_port], 1, + __ATOMIC_RELAXED); +} + static void udp_connection_unregister_port (u16 lcl_port, u8 is_ip4) { -- cgit 1.2.3-korg