VPP-990 remove registered handler if control ping fails
Change-Id: I5ca5763f0dc0a73cc6f014b855426b7ac180f356 Signed-off-by: Matej Perina <mperina@cisco.com>
This commit is contained in:

committed by
Florin Coras

parent
a4980b8f3e
commit
75a17ecddc
@ -144,6 +144,7 @@ void vl_msg_api_set_handlers (int msg_id, char *msg_name,
|
|||||||
void *cleanup,
|
void *cleanup,
|
||||||
void *endian,
|
void *endian,
|
||||||
void *print, int msg_size, int traced);
|
void *print, int msg_size, int traced);
|
||||||
|
void vl_msg_api_clean_handlers (int msg_id);
|
||||||
void vl_msg_api_config (vl_msg_api_msg_config_t *);
|
void vl_msg_api_config (vl_msg_api_msg_config_t *);
|
||||||
void vl_msg_api_set_cleanup_handler (int msg_id, void *fp);
|
void vl_msg_api_set_cleanup_handler (int msg_id, void *fp);
|
||||||
void vl_msg_api_queue_handler (unix_shared_memory_queue_t * q);
|
void vl_msg_api_queue_handler (unix_shared_memory_queue_t * q);
|
||||||
|
@ -716,6 +716,18 @@ vl_msg_api_set_handlers (int id, char *name, void *handler, void *cleanup,
|
|||||||
vl_msg_api_config (c);
|
vl_msg_api_config (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
vl_msg_api_clean_handlers (int msg_id)
|
||||||
|
{
|
||||||
|
vl_msg_api_msg_config_t cfg;
|
||||||
|
vl_msg_api_msg_config_t *c = &cfg;
|
||||||
|
|
||||||
|
memset (c, 0, sizeof (*c));
|
||||||
|
|
||||||
|
c->id = msg_id;
|
||||||
|
vl_msg_api_config (c);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vl_msg_api_set_cleanup_handler (int msg_id, void *fp)
|
vl_msg_api_set_cleanup_handler (int msg_id, void *fp)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +239,7 @@ static int send_initial_control_ping() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
|
vl_msg_api_clean_handlers(rm->control_ping_reply_msg_id);
|
||||||
clib_warning("first control ping failed: %d", rv);
|
clib_warning("first control ping failed: %d", rv);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
|
Reference in New Issue
Block a user