summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-07-08 08:25:09 -0700
committerDave Barach <openvpp@barachs.net>2021-07-08 21:43:34 +0000
commita4d0956082f12ac8269fd415134af7f605c1f3c9 (patch)
treefb0296ce060e3d6ba77323ab716c738f6efb8287
parent8e3f109a0664404c36bdcb6b5a20d836c1d7d887 (diff)
session: allow listen in any fib if default namespace
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If0712f01bdd6f2fc892bcbe4e2cee28affd02520
-rw-r--r--src/vnet/session/application.c6
-rw-r--r--src/vnet/session/session_lookup.c8
-rw-r--r--src/vnet/session/session_lookup.h1
3 files changed, 12 insertions, 3 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 8a304f965f6..d7c5980774b 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -241,9 +241,9 @@ app_listener_alloc_and_init (application_t * app,
{
fib_protocol_t fib_proto;
fib_proto = session_endpoint_fib_proto ((session_endpoint_t *) sep);
- table_index = session_lookup_get_index_for_fib (fib_proto,
- sep->fib_index);
- ASSERT (table_index != SESSION_TABLE_INVALID_INDEX);
+ /* Assume namespace vetted previously so make sure table exists */
+ table_index = session_lookup_get_or_alloc_index_for_fib (
+ fib_proto, sep->fib_index);
session_lookup_add_session_endpoint (table_index,
(session_endpoint_t *) sep,
lh);
diff --git a/src/vnet/session/session_lookup.c b/src/vnet/session/session_lookup.c
index 3b330982954..6e060cb119d 100644
--- a/src/vnet/session/session_lookup.c
+++ b/src/vnet/session/session_lookup.c
@@ -214,6 +214,14 @@ session_lookup_get_index_for_fib (u32 fib_proto, u32 fib_index)
return fib_index_to_table_index[fib_proto][fib_index];
}
+u32
+session_lookup_get_or_alloc_index_for_fib (u32 fib_proto, u32 fib_index)
+{
+ session_table_t *st;
+ st = session_table_get_or_alloc (fib_proto, fib_index);
+ return session_table_index (st);
+}
+
/**
* Add transport connection to a session table
*
diff --git a/src/vnet/session/session_lookup.h b/src/vnet/session/session_lookup.h
index 4e80566953e..c1037dff8c9 100644
--- a/src/vnet/session/session_lookup.h
+++ b/src/vnet/session/session_lookup.h
@@ -92,6 +92,7 @@ transport_connection_t *session_lookup_half_open_connection (u64 handle,
u8 proto,
u8 is_ip4);
u32 session_lookup_get_index_for_fib (u32 fib_proto, u32 fib_index);
+u32 session_lookup_get_or_alloc_index_for_fib (u32 fib_proto, u32 fib_index);
void session_lookup_show_table_entries (vlib_main_t * vm,
session_table_t * table, u8 type,