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>
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index dbb0d65..0eaab6c 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -737,14 +737,17 @@
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 @@
if (vec_len (vcm->workers) == 1)
vl_client_disconnect_from_vlib ();
else
- vl_client_send_disconnect ();
+ vl_client_send_disconnect (1 /* vpp should cleanup */ );
}
/*