summaryrefslogtreecommitdiff
path: root/src/ipcpd/eth
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2020-09-26 16:30:37 +0200
committerSander Vrijders <sander@ouroboros.rocks>2020-09-26 16:32:26 +0200
commit74c4155dc472651be9c40528657bdf35bfffd87c (patch)
tree8ddead3927c96bc5e53098e113db4d7f66670652 /src/ipcpd/eth
parent59f2230689a3c07cfee0578b491660c1fc471390 (diff)
downloadouroboros-74c4155dc472651be9c40528657bdf35bfffd87c.tar.gz
ouroboros-74c4155dc472651be9c40528657bdf35bfffd87c.zip
ipcpd: Improve locking np1_flow_set in eth and udp
A flow_set is thread-safe and doesn't need to be protected by a lock. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/eth')
-rw-r--r--src/ipcpd/eth/eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index 618ba44f..324c1ddc 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -1790,10 +1790,10 @@ static int eth_ipcp_flow_dealloc(int fd)
#endif
ipcp_flow_fini(fd);
- pthread_rwlock_wrlock(&eth_data.flows_lock);
-
fset_del(eth_data.np1_flows, fd);
+ pthread_rwlock_wrlock(&eth_data.flows_lock);
+
#if defined(BUILD_ETH_DIX)
eth_data.fd_to_ef[fd].r_eid = -1;
#elif defined BUILD_ETH_LLC