summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-03-02 13:13:23 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-02 20:33:52 +0000
commita1a093d4e46e38503332a97ad216f80053a15f2b (patch)
treeac0c40a3985b9593b141b534978d3f3ee91a65ec /src/vlib
parent25b36674f7e9072084f8f149067450f5eb6a5841 (diff)
Clean up binary api message handler registration issues
Removed a fair number of "BUG" message handlers, due to conflicts with actual message handlers in api_format.c. Vpp itself had no business receiving certain messages, up to the point where we started building in relevant code from vpp_api_test. Eliminated all but one duplicate registration complaint. That one needs attention from the vxlan team since the duplicated handlers have diverged. Change-Id: Iafce5429d2f906270643b4ea5f0130e20beb4d1d Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/unix/input.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/vlib/unix/input.c b/src/vlib/unix/input.c
index 07096ed27dc..7b4183a4a70 100644
--- a/src/vlib/unix/input.c
+++ b/src/vlib/unix/input.c
@@ -66,6 +66,7 @@ linux_epoll_file_update (unix_file_t * f, unix_file_update_type_t update_type)
unix_main_t *um = &unix_main;
linux_epoll_main_t *em = &linux_epoll_main;
struct epoll_event e;
+ int op;
memset (&e, 0, sizeof (e));
@@ -76,13 +77,29 @@ linux_epoll_file_update (unix_file_t * f, unix_file_update_type_t update_type)
e.events |= EPOLLET;
e.data.u32 = f - um->file_pool;
- if (epoll_ctl (em->epoll_fd,
- (update_type == UNIX_FILE_UPDATE_ADD
- ? EPOLL_CTL_ADD
- : (update_type == UNIX_FILE_UPDATE_MODIFY
- ? EPOLL_CTL_MOD
- : EPOLL_CTL_DEL)), f->file_descriptor, &e) < 0)
- clib_warning ("epoll_ctl");
+ op = -1;
+
+ switch (update_type)
+ {
+ case UNIX_FILE_UPDATE_ADD:
+ op = EPOLL_CTL_ADD;
+ break;
+
+ case UNIX_FILE_UPDATE_MODIFY:
+ op = EPOLL_CTL_MOD;
+ break;
+
+ case UNIX_FILE_UPDATE_DELETE:
+ op = EPOLL_CTL_DEL;
+ break;
+
+ default:
+ clib_warning ("unknown update_type %d", update_type);
+ return;
+ }
+
+ if (epoll_ctl (em->epoll_fd, op, f->file_descriptor, &e) < 0)
+ clib_unix_warning ("epoll_ctl");
}
static uword