summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-09-20 08:40:16 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-09-20 15:52:47 +0000
commit392206e55a1cbfb0a2e03ae310a4d3953bf3f194 (patch)
tree9b2326d15578b7d4c294ed8a312136eca81d9298
parent649296428b669b67b55ef2e701830fb8e676c6b6 (diff)
Improve API message handler re-registration check
Change-Id: Iedcea2fb45052852666b91a21eed011f5593313d Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--src/vlibapi/api_shared.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c
index 59dc2375cf6..0c4952b189c 100644
--- a/src/vlibapi/api_shared.c
+++ b/src/vlibapi/api_shared.c
@@ -671,9 +671,11 @@ vl_msg_api_config (vl_msg_api_msg_config_t * c)
foreach_msg_api_vector;
#undef _
- if (am->msg_names[c->id])
- clib_warning ("BUG: multiple registrations of 'vl_api_%s_t_handler'",
- c->name);
+ if (am->msg_handlers[c->id] && am->msg_handlers[c->id] != c->handler)
+ clib_warning
+ ("BUG: re-registering 'vl_api_%s_t_handler'."
+ "Handler was %llx, replaced by %llx",
+ c->name, am->msg_handlers[c->id], c->handler);
am->msg_names[c->id] = c->name;
am->msg_handlers[c->id] = c->handler;