From: Florin Coras Date: Wed, 7 Feb 2024 19:42:02 +0000 (-0800) Subject: udp: unregister ports on all cleanups X-Git-Tag: v24.10-rc0~243 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=81a6ffced1a5793e2135854501cfb68d40f9c87a;p=vpp.git 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 Change-Id: Id0a2c60c5faf4dea8b2cd9ded0334934ad9e918c --- 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); }