47 lines
1.5 KiB
Diff
47 lines
1.5 KiB
Diff
|
|
From 6c23bfa512187d509ecc188653a6f232b0695d1d Mon Sep 17 00:00:00 2001
|
||
|
|
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
||
|
|
Date: Mon, 27 Jun 2022 12:54:23 +0200
|
||
|
|
Subject: [PATCH] segtree: fix map listing with interface wildcard
|
||
|
|
|
||
|
|
# nft -f - <<'EOF'
|
||
|
|
table inet filter {
|
||
|
|
chain INPUT {
|
||
|
|
iifname vmap {
|
||
|
|
"eth0" : jump input_lan,
|
||
|
|
"wg*" : jump input_vpn
|
||
|
|
}
|
||
|
|
}
|
||
|
|
chain input_lan {}
|
||
|
|
chain input_vpn {}
|
||
|
|
}
|
||
|
|
EOF
|
||
|
|
# nft list ruleset
|
||
|
|
nft: segtree.c:578: interval_map_decompose: Assertion `low->len / 8 > 0' failed.
|
||
|
|
|
||
|
|
Conflict: remove tests/shell/testcases/sets/dumps/sets_with_ifnames.nft
|
||
|
|
Reference: https://git.netfilter.org/nftables/commit?id=6c23bfa512187d509ecc188653a6f232b0695d1d
|
||
|
|
|
||
|
|
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1617
|
||
|
|
Fixes: 5e393ea1fc0a ("segtree: add string "range" reversal support")
|
||
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||
|
|
---
|
||
|
|
src/segtree.c | 2 +-
|
||
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/src/segtree.c b/src/segtree.c
|
||
|
|
index 0135a07..cc60879 100644
|
||
|
|
--- a/src/segtree.c
|
||
|
|
+++ b/src/segtree.c
|
||
|
|
@@ -1160,7 +1160,7 @@ void interval_map_decompose(struct expr *set)
|
||
|
|
|
||
|
|
if (!mpz_cmp_ui(range, 0)) {
|
||
|
|
if (expr_basetype(low)->type == TYPE_STRING)
|
||
|
|
- mpz_switch_byteorder(expr_value(low)->value, low->len / BITS_PER_BYTE);
|
||
|
|
+ mpz_switch_byteorder(expr_value(low)->value, expr_value(low)->len / BITS_PER_BYTE);
|
||
|
|
|
||
|
|
compound_expr_add(set, expr_get(low));
|
||
|
|
} else if (range_is_prefix(range) && !mpz_cmp_ui(p, 0)) {
|
||
|
|
--
|
||
|
|
2.33.0
|
||
|
|
|