summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-10-03 09:51:52 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-10-03 10:30:08 +0200
commit0698f576d98ed1c4131d419c40019090f3ae06d1 (patch)
treeca6807eb47e9198c71112c432fb8a423dd771930
parente00181b492d573ecd0621f55d9ad24f134c09d4c (diff)
downloadouroboros-0698f576d98ed1c4131d419c40019090f3ae06d1.tar.gz
ouroboros-0698f576d98ed1c4131d419c40019090f3ae06d1.zip
ipcpd: Fix bad lock in Ethernet IPCP
An unlock was called twice instead of a lock/unlock sequence, causing a data race. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
-rw-r--r--src/ipcpd/eth/eth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index af34f68e..9456f4cb 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -905,8 +905,8 @@ static void * eth_ipcp_sdu_reader(void * o)
memcpy(frame->buf, &e_frame->payload, length);
memcpy(frame->r_addr, e_frame->src_hwaddr, MAC_SIZE);
- pthread_mutex_unlock(&eth_data.mgmt_lock);
+ pthread_mutex_lock(&eth_data.mgmt_lock);
list_add(&frame->next, &eth_data.mgmt_frames);
pthread_cond_signal(&eth_data.mgmt_cond);
pthread_mutex_unlock(&eth_data.mgmt_lock);