diff options
author | Sander Vrijders <[email protected]> | 2018-10-03 09:51:52 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-10-03 10:30:08 +0200 |
commit | 0698f576d98ed1c4131d419c40019090f3ae06d1 (patch) | |
tree | ca6807eb47e9198c71112c432fb8a423dd771930 /src/ipcpd/eth | |
parent | e00181b492d573ecd0621f55d9ad24f134c09d4c (diff) | |
download | ouroboros-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 <[email protected]>
Signed-off-by: Dimitri Staessens <[email protected]>
Diffstat (limited to 'src/ipcpd/eth')
-rw-r--r-- | src/ipcpd/eth/eth.c | 2 |
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(ð_data.mgmt_lock); + pthread_mutex_lock(ð_data.mgmt_lock); list_add(&frame->next, ð_data.mgmt_frames); pthread_cond_signal(ð_data.mgmt_cond); pthread_mutex_unlock(ð_data.mgmt_lock); |