diff options
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/application_local.c | 5 | ||||
-rw-r--r-- | src/vnet/session/session_lookup.c | 21 | ||||
-rw-r--r-- | src/vnet/session/session_lookup.h | 2 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c index 83a6c8eb49c..d1df657229d 100644 --- a/src/vnet/session/application_local.c +++ b/src/vnet/session/application_local.c @@ -274,7 +274,8 @@ ct_connect (app_worker_t * client_wrk, session_t * ll, */ ss = session_alloc (0); ll = listen_session_get (ll_index); - ss->session_type = ll->session_type; + ss->session_type = session_type_from_proto_and_ip (TRANSPORT_PROTO_NONE, + sct->c_is_ip4); ss->connection_index = sct->c_c_index; ss->listener_index = ll->session_index; ss->session_state = SESSION_STATE_CREATED; @@ -394,7 +395,7 @@ global_scope: fib_proto = session_endpoint_fib_proto (sep); table_index = application_session_table (app, fib_proto); - ll = session_lookup_listener (table_index, sep); + ll = session_lookup_listener_wildcard (table_index, sep); if (ll) return ct_connect (app_wrk, ll, sep_ext); diff --git a/src/vnet/session/session_lookup.c b/src/vnet/session/session_lookup.c index d7e932a96e4..1d9662caf0f 100644 --- a/src/vnet/session/session_lookup.c +++ b/src/vnet/session/session_lookup.c @@ -723,6 +723,27 @@ session_lookup_listener (u32 table_index, session_endpoint_t * sep) return 0; } +/** + * Lookup listener wildcard match + */ +session_t * +session_lookup_listener_wildcard (u32 table_index, session_endpoint_t * sep) +{ + session_table_t *st; + st = session_table_get (table_index); + if (!st) + return 0; + if (sep->is_ip4) + return session_lookup_listener4_i (st, &sep->ip.ip4, sep->port, + sep->transport_proto, + 1 /* use_wildcard */ ); + else + return session_lookup_listener6_i (st, &sep->ip.ip6, sep->port, + sep->transport_proto, + 1 /* use_wildcard */ ); + return 0; +} + int session_lookup_add_half_open (transport_connection_t * tc, u64 value) { diff --git a/src/vnet/session/session_lookup.h b/src/vnet/session/session_lookup.h index 8d7701da19e..63ba6c3cde9 100644 --- a/src/vnet/session/session_lookup.h +++ b/src/vnet/session/session_lookup.h @@ -67,6 +67,8 @@ session_t *session_lookup_listener6 (u32 fib_index, u8 proto); session_t *session_lookup_listener (u32 table_index, session_endpoint_t * sep); +session_t *session_lookup_listener_wildcard (u32 table_index, + session_endpoint_t * sep); int session_lookup_add_connection (transport_connection_t * tc, u64 value); int session_lookup_del_connection (transport_connection_t * tc); u64 session_lookup_endpoint_listener (u32 table_index, |