]> git.ipfire.org Git - thirdparty/suricata.git/commit
flow-manager: fix off-by-one in flow_hash row allocation 7206/head
authorArne Welzel <arne.welzel@corelight.com>
Sat, 12 Feb 2022 16:49:07 +0000 (17:49 +0100)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 5 Apr 2022 07:42:05 +0000 (13:12 +0530)
commit22c47396fde41494e1eb5aa272477f09fbd085ea
treeae792dcfb414ad9679e56f0cbaafa8274251c144
parent16c52db46533b3c32eaef2b80bbff470389dfa5b
flow-manager: fix off-by-one in flow_hash row allocation

The current code doesn't cover all rows when more than one flow manager is
used. It leaves a single row between ftd->max and ftd->min of the next
manager orphaned. As an example:

    hash_size=1000
    flowmgr_number=3
    range=333

    instance  ftd->min  ftd->max
    0         0         333
    1         334       666
    2         667       1000

    Rows not covered: 333, 666

(cherry picked from commit 8ef066318d7c4dd9b6686dbebd621c790828c384)
src/flow-manager.c