aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-03 18:53:48 -0700
committerDave Wallace <dwallacelf@gmail.com>2019-08-05 16:22:17 +0000
commit470b2a61659d76c1fc03352d42af6f3f3945330f (patch)
tree6ad7f02b151e0a22df559ac125b8da919782e866 /src
parent7858d6e9e2e3aa118638676a202e600fc9668986 (diff)
vcl: fix bapi disconnect with socket transport
Type:fix Change-Id: I7b69c28118f3d7054a20ca48792dfc403a8e2694 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-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 */ );
}