From ca22ee6c603d3a03cca902d302f4c25e1f5b003e Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 11 Oct 2018 15:58:12 +0200 Subject: ipcpd: Call send_lsm under read lock send_lsm was being called from the event handler as well as from lsupdate. The first one was not being locked properly. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/ipcpd/normal/pol/link_state.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipcpd/normal/pol/link_state.c b/src/ipcpd/normal/pol/link_state.c index 8db1a9c5..e8677f0d 100644 --- a/src/ipcpd/normal/pol/link_state.c +++ b/src/ipcpd/normal/pol/link_state.c @@ -795,7 +795,9 @@ static void handle_event(void * self, if (lsdb_add_link(ipcpi.dt_addr, c->conn_info.addr, 0, &qs)) log_dbg("Failed to add new adjacency to LSDB."); + pthread_rwlock_rdlock(&ls.db_lock); send_lsm(ipcpi.dt_addr, c->conn_info.addr, 0); + pthread_rwlock_unlock(&ls.db_lock); break; case NOTIFY_DT_CONN_DEL: -- cgit v1.2.3