vcl: ldp support SO_ORIGINAL_DST
[vpp.git] / src / vnet / session / application.c
index 7f88c7a..5998921 100644 (file)
@@ -189,6 +189,7 @@ app_listener_alloc_and_init (application_t * app,
        {
          ls = session_get_from_handle (lh);
          session_free (ls);
+         app_listener_free (app, app_listener);
          return rv;
        }
 
@@ -223,6 +224,7 @@ app_listener_alloc_and_init (application_t * app,
        {
          ls = listen_session_get_from_handle (lh);
          session_free (ls);
+         app_listener_free (app, app_listener);
          return rv;
        }
       ls = listen_session_get_from_handle (lh);
@@ -819,6 +821,8 @@ application_alloc_and_init (app_init_args_t * a)
       props->add_segment_size = opts[APP_OPTIONS_ADD_SEGMENT_SIZE];
       props->add_segment = 1;
     }
+  if (opts[APP_OPTIONS_FLAGS] & APP_OPTIONS_FLAGS_USE_HUGE_PAGE)
+    props->huge_page = 1;
   if (opts[APP_OPTIONS_RX_FIFO_SIZE])
     props->rx_fifo_size = opts[APP_OPTIONS_RX_FIFO_SIZE];
   if (opts[APP_OPTIONS_TX_FIFO_SIZE])
@@ -1355,7 +1359,7 @@ vnet_connect (vnet_connect_args_t * a)
   app_worker_t *client_wrk;
   application_t *client;
 
-  ASSERT (vlib_thread_is_main_w_barrier ());
+  ASSERT (session_vlib_thread_is_cl_thread ());
 
   if (session_endpoint_is_zero (&a->sep))
     return SESSION_E_INVALID_RMT_IP;
@@ -1525,6 +1529,12 @@ application_has_global_scope (application_t * app)
   return app->flags & APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
 }
 
+int
+application_original_dst_is_enabled (application_t *app)
+{
+  return app->flags & APP_OPTIONS_FLAGS_GET_ORIGINAL_DST;
+}
+
 static clib_error_t *
 application_start_stop_proxy_fib_proto (application_t * app, u8 fib_proto,
                                        u8 transport_proto, u8 is_start)
@@ -1681,7 +1691,7 @@ application_format_listeners (application_t * app, int verbose)
 
   if (!app)
     {
-      vlib_cli_output (vm, "%U", format_app_worker_listener, 0 /* header */ ,
+      vlib_cli_output (vm, "%U", format_app_worker_listener, NULL /* header */,
                       0, 0, verbose);
       return;
     }