diff options
Diffstat (limited to 'src/vnet/session')
-rwxr-xr-x | src/vnet/session/session_api.c | 6 | ||||
-rw-r--r-- | src/vnet/session/transport.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index 5201ec60751..a1225f83e8c 100755 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -354,6 +354,10 @@ vl_api_application_attach_t_handler (vl_api_application_attach_t * mp) clib_error_t *error = 0; int rv = 0; + reg = vl_api_client_index_to_registration (mp->client_index); + if (!reg) + return; + if (session_manager_is_enabled () == 0) { rv = VNET_API_ERROR_FEATURE_DISABLED; @@ -410,8 +414,6 @@ done: if (rv) return; - reg = vl_api_client_index_to_registration (mp->client_index); - /* Send fifo segment fd if needed */ if (ssvm_type (a->segment) == SSVM_SEGMENT_MEMFD) session_send_memfd_fd (reg, a->segment); diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c index c31964c88b6..acbb4f65e7a 100644 --- a/src/vnet/session/transport.c +++ b/src/vnet/session/transport.c @@ -310,6 +310,13 @@ transport_alloc_local_endpoint (u8 proto, transport_endpoint_t * rmt, { ip4_address_t *ip4; ip4 = ip_interface_get_first_ip (sw_if_index, 1); + if (!ip4) + { + clib_warning ("no routable ip4 address on %U", + format_vnet_sw_if_index_name, vnet_get_main (), + sw_if_index); + return -1; + } lcl_addr->ip4.as_u32 = ip4->as_u32; } else |