tcp: add option to avoid endpoint cleanup 80/24880/3
authorFlorin Coras <fcoras@cisco.com>
Sun, 9 Feb 2020 23:09:26 +0000 (23:09 +0000)
committerDave Barach <openvpp@barachs.net>
Mon, 10 Feb 2020 20:13:02 +0000 (20:13 +0000)
Type: feature

If set, avoid trying to cleanup the local endpoint table.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iaa382ae74523d608217d2d17544bf1e7d82b2728

src/vnet/tcp/tcp.c
src/vnet/tcp/tcp.h

index 3fa242e..0c2523c 100644 (file)
@@ -242,8 +242,9 @@ tcp_connection_cleanup (tcp_connection_t * tc)
   TCP_EVT (TCP_EVT_DELETE, tc);
 
   /* Cleanup local endpoint if this was an active connect */
-  transport_endpoint_cleanup (TRANSPORT_PROTO_TCP, &tc->c_lcl_ip,
-                             tc->c_lcl_port);
+  if (!(tc->cfg_flags & TCP_CFG_F_NO_ENDPOINT))
+    transport_endpoint_cleanup (TRANSPORT_PROTO_TCP, &tc->c_lcl_ip,
+                               tc->c_lcl_port);
 
   /* Check if connection is not yet fully established */
   if (tc->state == TCP_STATE_SYN_SENT)
index 896a69b..73d5970 100644 (file)
@@ -109,6 +109,7 @@ extern timer_expiration_handler tcp_timer_retransmit_syn_handler;
   _(NO_CSUM_OFFLOAD, "No csum offload")        \
   _(NO_TSO, "TSO off")                         \
   _(TSO, "TSO")                                        \
+  _(NO_ENDPOINT,"No endpoint")                 \
 
 typedef enum tcp_cfg_flag_bits_
 {