aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vcl/vcl_bapi.c11
-rw-r--r--src/vcl/vcl_private.h1
-rw-r--r--src/vcl/vppcom.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/src/vcl/vcl_bapi.c b/src/vcl/vcl_bapi.c
index 2bfc7c73f92..de64809d52a 100644
--- a/src/vcl/vcl_bapi.c
+++ b/src/vcl/vcl_bapi.c
@@ -681,6 +681,17 @@ vppcom_connect_to_vpp (char *app_name)
return VPPCOM_OK;
}
+void
+vppcom_disconnect_from_vpp (void)
+{
+ vppcom_cfg_t *vcl_cfg = &vcm->cfg;
+
+ if (vcl_cfg->vpp_api_socket_name)
+ vl_socket_client_disconnect ();
+ else
+ vl_client_disconnect_from_vlib ();
+}
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 552fdd811ec..43c8ec304ef 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -598,6 +598,7 @@ void vcl_send_session_worker_update (vcl_worker_t * wrk, vcl_session_t * s,
* VCL Binary API
*/
int vppcom_connect_to_vpp (char *app_name);
+void vppcom_disconnect_from_vpp (void);
void vppcom_init_error_string_table (void);
void vppcom_send_session_enable_disable (u8 is_enable);
void vppcom_app_send_attach (void);
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 0ee1784740a..0060922fea6 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -922,7 +922,7 @@ vppcom_app_exit (void)
vcl_set_worker_index (~0);
vcl_elog_stop (vcm);
if (vec_len (vcm->workers) == 1)
- vl_client_disconnect_from_vlib ();
+ vppcom_disconnect_from_vpp ();
else
vl_client_send_disconnect (1 /* vpp should cleanup */ );
}