summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2022-03-25 08:24:45 +0100
committerSander Vrijders <[email protected]>2022-03-30 15:05:04 +0200
commit0b45e1e5363f61febc7033f1b9bda14689c88644 (patch)
treec81878352145ef421f6ddd33c33969dbafad0caf /src/lib/dev.c
parenta9ac222ee08158adacf4892c9b237305b1c6049e (diff)
downloadouroboros-0b45e1e5363f61febc7033f1b9bda14689c88644.tar.gz
ouroboros-0b45e1e5363f61febc7033f1b9bda14689c88644.zip
lib: Notify once for packets in new fset
The fset add function was notifying for each packet already stored in the rx rbuff, which isn't needed. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 5f6a3694..d73205e2 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -1459,8 +1459,6 @@ int fset_add(struct flow_set * set,
struct flow * flow;
struct flow_set_entry * fse;
int ret;
- size_t packets;
- size_t i;
if (set == NULL || fd < 0 || fd >= SYS_MAX_FLOWS)
return -EINVAL;
@@ -1493,8 +1491,7 @@ int fset_add(struct flow_set * set,
pthread_rwlock_unlock(&set->lock);
- packets = shm_rbuff_queued(ai.flows[fd].rx_rb);
- for (i = 0; i < packets; i++)
+ if (shm_rbuff_queued(ai.flows[fd].rx_rb))
shm_flow_set_notify(ai.fqset, ai.flows[fd].flow_id, FLOW_PKT);
pthread_rwlock_unlock(&ai.lock);