From aab0604c47f9d6e3fadb894b3f081085833f62b3 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 26 Feb 2020 02:56:14 +0000 Subject: tls session: fix unlisten Type: fix Signed-off-by: Florin Coras Change-Id: Ie3bc31fc3df662e087f7931de6c274eb3608a2d8 --- src/vnet/session/session_lookup.c | 26 ++++++++++++++++++++++++++ src/vnet/session/session_lookup.h | 1 + 2 files changed, 27 insertions(+) (limited to 'src/vnet/session') diff --git a/src/vnet/session/session_lookup.c b/src/vnet/session/session_lookup.c index abaad5019fa..986832346fc 100644 --- a/src/vnet/session/session_lookup.c +++ b/src/vnet/session/session_lookup.c @@ -300,6 +300,32 @@ session_lookup_del_session_endpoint (u32 table_index, } } +int +session_lookup_del_session_endpoint2 (session_endpoint_t * sep) +{ + fib_protocol_t fib_proto; + session_table_t *st; + session_kv4_t kv4; + session_kv6_t kv6; + + fib_proto = sep->is_ip4 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6; + st = session_table_get_for_fib_index (fib_proto, sep->fib_index); + if (!st) + return -1; + if (sep->is_ip4) + { + make_v4_listener_kv (&kv4, &sep->ip.ip4, sep->port, + sep->transport_proto); + return clib_bihash_add_del_16_8 (&st->v4_session_hash, &kv4, 0); + } + else + { + make_v6_listener_kv (&kv6, &sep->ip.ip6, sep->port, + sep->transport_proto); + return clib_bihash_add_del_48_8 (&st->v6_session_hash, &kv6, 0); + } +} + /** * Delete transport connection from session table * diff --git a/src/vnet/session/session_lookup.h b/src/vnet/session/session_lookup.h index c2e644654fb..8224219c4e2 100644 --- a/src/vnet/session/session_lookup.h +++ b/src/vnet/session/session_lookup.h @@ -80,6 +80,7 @@ int session_lookup_add_session_endpoint (u32 table_index, session_endpoint_t * sep, u64 value); int session_lookup_del_session_endpoint (u32 table_index, session_endpoint_t * sep); +int session_lookup_del_session_endpoint2 (session_endpoint_t * sep); int session_lookup_del_session (session_t * s); int session_lookup_del_half_open (transport_connection_t * tc); int session_lookup_add_half_open (transport_connection_t * tc, u64 value); -- cgit 1.2.3-korg