fw4: ensure that negative bitcounts are properly translated
authorJo-Philipp Wich <jo@mein.io>
Mon, 30 May 2022 17:28:12 +0000 (19:28 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 30 May 2022 17:30:38 +0000 (19:30 +0200)
commitc7c9c84b2fcf5c3b122e5072b9976744d6c70382
treea1c275c59c27f598a93f2015bfd41130621ad379
parentc4a78edb617a7157c5aa9f61cee2e2afc3ea2099
fw4: ensure that negative bitcounts are properly translated

Set bits to `-1` after converting a negative count into an inverted mask,
in order to ensure that the resulting subnet list is properly grouped
and rendered later on.

Also add some minimal test coverage for this case.

Fixes: #9764
Fixes: c22eeef ("fw4: support negative CIDR bit notation")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/ucode/fw4.uc
tests/03_rules/06_subnet_mask_matches