summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMercury <mercury124185@gmail.com>2021-12-23 19:15:02 +0800
committerFlorin Coras <florin.coras@gmail.com>2021-12-23 17:15:59 +0000
commit65409fb341c110bf905be0e29833405bb3bbf4e6 (patch)
treee2c9eb54271826ebf511caecc7dc1f8d5873d4f1 /src
parentcdfe8abc613a0aa936963d31bc60cec86a5c641d (diff)
tcp: fix endpoint lookup failed caused by key uninitialized
fix ipv4 key uninitialized in local_endpoints_table, which will cause transport_endpoint_cleanup() failed to lookup the endpoint and can not delete it, as for ipv6, clib_memcpy_fast() will change all bytes of lcl_addr and there maybe no need to initalize, Type: fix Signed-off-by: Mercury <mercury124185@gmail.com> Change-Id: I56676493a393b1d64eaa438224e256094ca75d2f
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index d4b1d77f556..af985d2de86 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -769,6 +769,7 @@ tcp_alloc_custom_local_endpoint (tcp_main_t * tm, ip46_address_t * lcl_addr,
index = tm->last_v4_addr_rotor++;
if (tm->last_v4_addr_rotor >= vec_len (tcp_cfg.ip4_src_addrs))
tm->last_v4_addr_rotor = 0;
+ clib_memset (lcl_addr, 0, sizeof (*lcl_addr));
lcl_addr->ip4.as_u32 = tcp_cfg.ip4_src_addrs[index].as_u32;
}
else