From 1c7dcc2d37dc5a41379ca08b523bda58a51f11de Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 26 Jul 2018 14:57:03 +0200 Subject: ipcpd: Check if mgmt flow event is FLOW_PKT The management flows were considering every event to be a FLOW_PKT event, when in fact it could also be a flow down or up event, resulting in indefinite reads. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- CMakeLists.txt | 2 +- src/ipcpd/normal/pol/link_state.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7893774b..5e51e2f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ include(GNUInstallDirs) set(PACKAGE_VERSION_MAJOR 0) set(PACKAGE_VERSION_MINOR 11) -set(PACKAGE_VERSION_PATCH 11) +set(PACKAGE_VERSION_PATCH 12) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(PACKAGE_DESCRIPTION "The Ouroboros prototype") diff --git a/src/ipcpd/normal/pol/link_state.c b/src/ipcpd/normal/pol/link_state.c index c6d641c2..1c418ffc 100644 --- a/src/ipcpd/normal/pol/link_state.c +++ b/src/ipcpd/normal/pol/link_state.c @@ -727,6 +727,9 @@ static void * lsreader(void * o) } while ((fd = fqueue_next(fq)) >= 0) { + if (fqueue_type(fq) != FLOW_PKT) + continue; + len = flow_read(fd, buf, sizeof(*msg)); if (len <= 0 || len != sizeof(*msg)) continue; @@ -822,7 +825,7 @@ static void handle_event(void * self, case NOTIFY_MGMT_CONN_DEL: fset_del(ls.mgmt_set, c->flow_info.fd); if (lsdb_del_nb(c->conn_info.addr, c->flow_info.fd)) - log_warn("Failed to add mgmt neighbor to LSDB."); + log_warn("Failed to delete mgmt neighbor from LSDB."); break; default: break; -- cgit v1.2.3