summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/session/session.c13
-rw-r--r--src/vnet/tcp/builtin_client.c14
2 files changed, 24 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 991bcd5a53f..533a6c22ae0 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -266,7 +266,13 @@ stream_session_enqueue_notify (stream_session_t * s, u8 block)
return 0;
/* Get session's server */
- app = application_get (s->app_index);
+ app = application_get_if_valid (s->app_index);
+
+ if (PREDICT_FALSE (app == 0))
+ {
+ clib_warning ("invalid s->app_index = %d", s->app_index);
+ return 0;
+ }
/* Built-in server? Hand event to the callback... */
if (app->cb_fns.builtin_server_rx_callback)
@@ -327,8 +333,9 @@ session_manager_flush_enqueue_events (u32 thread_index)
stream_session_t *s0;
/* Get session */
- s0 = stream_session_get (session_indices_to_enqueue[i], thread_index);
- if (stream_session_enqueue_notify (s0, 0 /* don't block */ ))
+ s0 = stream_session_get_if_valid (session_indices_to_enqueue[i],
+ thread_index);
+ if (s0 == 0 || stream_session_enqueue_notify (s0, 0 /* don't block */ ))
{
errors++;
}
diff --git a/src/vnet/tcp/builtin_client.c b/src/vnet/tcp/builtin_client.c
index 938e07ba505..5fa5446091c 100644
--- a/src/vnet/tcp/builtin_client.c
+++ b/src/vnet/tcp/builtin_client.c
@@ -713,6 +713,20 @@ cleanup:
pool_free (tm->sessions);
+ /* Detach the application, so we can use different fifo sizes next time */
+ if (tm->test_client_attached)
+ {
+ vnet_app_detach_args_t _da, *da = &_da;
+ int rv;
+
+ da->app_index = tm->app_index;
+
+ rv = vnet_application_detach (da);
+ if (rv)
+ vlib_cli_output (vm, "WARNING: app detach failed...");
+ tm->test_client_attached = 0;
+ tm->app_index = ~0;
+ }
return 0;
}