summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-04 16:34:05 -0800
committerDave Barach <openvpp@barachs.net>2018-12-05 15:38:51 +0000
commiteaec2a6d9ab8b983aaee536be1a95846c07a9d7f (patch)
treefdea9758127769ab978e9fc5c737282a85ba821a /src/vcl
parent955bfbbb6968bdc99171bdebcda6dbe605af2004 (diff)
bapi: add options to have vpp cleanup client registration
A client can send a memclnt delete message and ask vpp to cleanup the shared memory queue. Obviously, in this case no delete reply is sent back to the client. Change-Id: I9c8375093f8607680ad498a6bed0690ba02a7c3b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vppcom.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index dbb0d657b8d..0eaab6cbd6b 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -737,14 +737,17 @@ vcl_intercept_sigchld_handler (int signum, siginfo_t * si, void *uc)
return;
child_wrk = vcl_worker_get_if_valid (wrk->forked_child);
- if (si->si_pid != child_wrk->current_pid)
+ if (!child_wrk)
+ goto done;
+
+ if (si && si->si_pid != child_wrk->current_pid)
{
VDBG (0, "unexpected child pid %u", si->si_pid);
- return;
+ goto done;
}
- if (child_wrk)
- vcl_cleanup_forked_child (wrk, child_wrk);
+ vcl_cleanup_forked_child (wrk, child_wrk);
+done:
if (old_sa.sa_flags & SA_SIGINFO)
{
void (*fn) (int, siginfo_t *, void *) = old_sa.sa_sigaction;
@@ -848,7 +851,7 @@ vppcom_app_exit (void)
if (vec_len (vcm->workers) == 1)
vl_client_disconnect_from_vlib ();
else
- vl_client_send_disconnect ();
+ vl_client_send_disconnect (1 /* vpp should cleanup */ );
}
/*