aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-02-07 11:42:02 -0800
committerDave Wallace <dwallacelf@gmail.com>2024-02-16 18:18:56 +0000
commit81a6ffced1a5793e2135854501cfb68d40f9c87a (patch)
tree7ec3e5325f181388d7b90f0e1f926ca01f32298e /src
parentd5d510f7959d91ed32d22412def97add4fc16fd4 (diff)
udp: unregister ports on all cleanups
UDP transport port refcount is incremented even if port is shared. So decrement it, by unregistering, whener udp connections are cleaned up. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id0a2c60c5faf4dea8b2cd9ded0334934ad9e918c
Diffstat (limited to 'src')
-rw-r--r--src/vnet/udp/udp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c
index a8e013001e8..e194b9cc643 100644
--- a/src/vnet/udp/udp.c
+++ b/src/vnet/udp/udp.c
@@ -91,10 +91,9 @@ udp_connection_free (udp_connection_t * uc)
static void
udp_connection_cleanup (udp_connection_t * uc)
{
- /* Unregister port from udp_local only if refcount went to zero */
- if (!transport_release_local_endpoint (TRANSPORT_PROTO_UDP, &uc->c_lcl_ip,
- uc->c_lcl_port))
- udp_connection_unregister_port (uc->c_lcl_port, uc->c_is_ip4);
+ transport_release_local_endpoint (TRANSPORT_PROTO_UDP, &uc->c_lcl_ip,
+ uc->c_lcl_port);
+ udp_connection_unregister_port (uc->c_lcl_port, uc->c_is_ip4);
udp_connection_free (uc);
}