summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2018-07-26 14:57:03 +0200
committerDimitri Staessens <[email protected]>2018-07-27 00:22:24 +0200
commit1c7dcc2d37dc5a41379ca08b523bda58a51f11de (patch)
treeea3313cc68500b8087393705a58d3f442ef8325c
parent55e1cd4caffbf8f31b03c53b99f27dc85c3a9aba (diff)
downloadouroboros-1c7dcc2d37dc5a41379ca08b523bda58a51f11de.tar.gz
ouroboros-1c7dcc2d37dc5a41379ca08b523bda58a51f11de.zip
ipcpd: Check if mgmt flow event is FLOW_PKT0.11.12
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 <[email protected]> Signed-off-by: Dimitri Staessens <[email protected]>
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/ipcpd/normal/pol/link_state.c5
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;