[PATCH] lib: Fix lock reversal in timerwheel

  • From: Dimitri Staessens <dimitri@ouroboros.rocks>
  • To: ouroboros@xxxxxxxxxxxxx
  • Date: Sat, 26 Feb 2022 12:07:01 +0100

There was a lock reversal in the timerwheel. There still is a thorough
revision needed of the locking in dev.c after the FRCP logic is
completed and tuned.

Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
---
 src/lib/frct.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/lib/frct.c b/src/lib/frct.c
index 2793f3c4..91fa9e92 100644
--- a/src/lib/frct.c
+++ b/src/lib/frct.c
@@ -233,8 +233,6 @@ static void __send_frct_pkt(int      fd,
 
         f = &ai.flows[fd];
 
-        pthread_rwlock_rdlock(&ai.lock);
-
         if (f->qs.cypher_s > 0 && crypt_encrypt(f, sdb) < 0)
                 goto fail;
 
@@ -247,8 +245,6 @@ static void __send_frct_pkt(int      fd,
 
         shm_flow_set_notify(f->set, f->flow_id, FLOW_PKT);
 
-        pthread_rwlock_unlock(&ai.lock);
-
         return;
 
  fail:
-- 
2.35.1


Other related posts: