diff options
author | Sander Vrijders <[email protected]> | 2018-07-26 14:57:03 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-07-27 00:22:24 +0200 |
commit | 1c7dcc2d37dc5a41379ca08b523bda58a51f11de (patch) | |
tree | ea3313cc68500b8087393705a58d3f442ef8325c /src/ipcpd | |
parent | 55e1cd4caffbf8f31b03c53b99f27dc85c3a9aba (diff) | |
download | ouroboros-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]>
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/normal/pol/link_state.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |