From a586eb1ab7699c2d0af7f4ef3de8039076c4c0f2 Mon Sep 17 00:00:00 2001
From: dimitri staessens <dimitri.staessens@ugent.be>
Date: Tue, 22 Aug 2017 22:18:41 +0200
Subject: ipcpd: Fix data race in connmgr

The removal of the mutex and signal in 198b709 was a mistake.
---
 src/ipcpd/normal/connmgr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c
index b7ba90d9..a83d71c3 100644
--- a/src/ipcpd/normal/connmgr.c
+++ b/src/ipcpd/normal/connmgr.c
@@ -120,7 +120,12 @@ static int add_ae_conn(const char *       name,
                 return -1;
         }
 
+        pthread_mutex_lock(&ae->conn_lock);
+
         list_add(&ae_conn->next, &ae->conn_list);
+        pthread_cond_signal(&ae->conn_cond);
+
+        pthread_mutex_unlock(&ae->conn_lock);
 
         pthread_rwlock_unlock(&connmgr.aes_lock);
 
-- 
cgit v1.2.3