diff mbox series

[ovs-dev] conntrack:fix conntrack_clean may access the same exp_list each time be called

Message ID 20230217034305.1728-1-liangmc1@chinatelecom.cn
State Superseded
Headers show
Series [ovs-dev] conntrack:fix conntrack_clean may access the same exp_list each time be called | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Liang Mancang Feb. 17, 2023, 3:43 a.m. UTC
when a exp_list contains more than the clean_end's number of nodes,
and these nodes will not expire immediately. Then, every times we
call conntrack_clean, it use the same next_sweep to get exp_list.

Actually, we should add i every times after we call ct_sweep.
---
 lib/conntrack.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

0-day Robot Feb. 17, 2023, 4:58 a.m. UTC | #1
Bleep bloop.  Greetings Liang Mancang, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Liang Mancang <liangmc1@chinatelecom.cn> needs to sign off.
Lines checked: 39, Warnings: 0, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index 524670e45..5029b2cda 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1512,12 +1512,13 @@  conntrack_clean(struct conntrack *ct, long long now)
     clean_end = n_conn_limit / 64;
 
     for (i = ct->next_sweep; i < N_EXP_LISTS; i++) {
-        count += ct_sweep(ct, &ct->exp_lists[i], now);
-
         if (count > clean_end) {
             next_wakeup = 0;
+
             break;
         }
+
+        count += ct_sweep(ct, &ct->exp_lists[i], now);
     }
 
     ct->next_sweep = (i < N_EXP_LISTS) ? i : 0;