}
static void
-session_endpoint_update_for_app (session_endpoint_t * sep,
+session_endpoint_update_for_app (session_endpoint_extended_t * sep,
application_t * app)
{
app_namespace_t *app_ns;
- app_ns = app_namespace_get (app->ns_index);
+ u32 ns_index;
+
+ ns_index = app->ns_index;
+
+ /* App is a transport proto, so fetch the calling app's ns */
+ if (app->flags & APP_OPTIONS_FLAGS_IS_TRANSPORT_APP)
+ {
+ app_worker_t *owner_wrk;
+ application_t *owner_app;
+
+ owner_wrk = app_worker_get (sep->app_wrk_index);
+ owner_app = application_get (owner_wrk->app_index);
+ ns_index = owner_app->ns_index;
+ }
+ app_ns = app_namespace_get (ns_index);
if (app_ns)
{
/* Ask transport and network to bind to/connect using local interface
app_wrk = application_get_worker (app, a->wrk_map_index);
a->sep_ext.app_wrk_index = app_wrk->wrk_index;
- session_endpoint_update_for_app (&a->sep, app);
+ session_endpoint_update_for_app (&a->sep_ext, app);
if (!session_endpoint_in_ns (&a->sep))
return VNET_API_ERROR_INVALID_VALUE_2;
return VNET_API_ERROR_INVALID_VALUE;
client = application_get (a->app_index);
- session_endpoint_update_for_app (&a->sep, client);
+ session_endpoint_update_for_app (&a->sep_ext, client);
client_wrk = application_get_worker (client, a->wrk_map_index);
/*
_(ACCEPT_REDIRECT, "Use FIFO with redirects") \
_(ADD_SEGMENT, "Add segment and signal app if needed") \
_(IS_BUILTIN, "Application is builtin") \
+ _(IS_TRANSPORT_APP, "Application is a transport proto") \
_(IS_PROXY, "Application is proxying") \
_(USE_GLOBAL_SCOPE, "App can use global session scope") \
_(USE_LOCAL_SCOPE, "App can use local session scope") \
a->options[APP_OPTIONS_TX_FIFO_SIZE] = fifo_size;
a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
a->options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
+ a->options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_IS_TRANSPORT_APP;
if (vnet_application_attach (a))
{