diff options
author | Sander Vrijders <[email protected]> | 2018-10-11 15:58:12 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-10-11 20:21:44 +0200 |
commit | ca22ee6c603d3a03cca902d302f4c25e1f5b003e (patch) | |
tree | be410ad1a9aeec453110d00c6689dddb7513180b /src | |
parent | a1b6cebe14d6e0689655a0c4d06064728cbf1f21 (diff) | |
download | ouroboros-ca22ee6c603d3a03cca902d302f4c25e1f5b003e.tar.gz ouroboros-ca22ee6c603d3a03cca902d302f4c25e1f5b003e.zip |
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 <[email protected]>
Signed-off-by: Dimitri Staessens <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/ipcpd/normal/pol/link_state.c | 2 |
1 files changed, 2 insertions, 0 deletions
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: |