summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-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,