Skip to contentSkip to conversation

evaluate: un-break rule insert with intervals

PATCH In review Florian Westphal 2 participants 3 messages Sep 20, 2022 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 evaluate: un-break rule insert with intervals

'rule inet dscpclassify dscp_match meta l4proto { udp } th dport { 3478 } th sport { 3478-3497, 16384-16387 } goto ct_set_ef' works with 'nft add', but not 'nft insert', the latter yields: "BUG: unhandled op 4".

Fixes 81e36530fcac ("src: replace interval segment tree overlap and automerge")
---
 src/evaluate.c | 1 +
 1 file changed, 1 insertion(+)
src/evaluate.c +1 -0
index d9c9ca28a53a..edebd7bcd8ab 100644
@@ -1520,6 +1520,7 @@ static int interval_set_eval(struct eval_ctx *ctx, struct set *set,
 	switch (ctx->cmd->op) {
 	case CMD_CREATE:
 	case CMD_ADD:
+	case CMD_INSERT:
 		if (set->automerge) {
 			ret = set_automerge(ctx->msgs, ctx->cmd, set, init,
 					    ctx->nft->debug_mask);
Signature · 1 line
2.35.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Florian Westphal

'rule inet dscpclassify dscp_match meta l4proto { udp } th dport { 3478 } th sport { 3478-3497, 16384-16387 } goto ct_set_ef' works with 'nft add', but not 'nft insert', the latter yields: "BUG: unhandled op 4".

That's my fault, thanks for the fix.

P.S: Please add a simple test for this regression.

Quoted 21 lines
Fixes 81e36530fcac ("src: replace interval segment tree overlap and automerge")
---
 src/evaluate.c | 1 +
 1 file changed, 1 insertion(+)
src/evaluate.c +1 -0
index d9c9ca28a53a..edebd7bcd8ab 100644
@@ -1520,6 +1520,7 @@ static int interval_set_eval(struct eval_ctx *ctx, struct set *set,
 	switch (ctx->cmd->op) {
 	case CMD_CREATE:
 	case CMD_ADD:
+	case CMD_INSERT:
 		if (set->automerge) {
 			ret = set_automerge(ctx->msgs, ctx->cmd, set, init,
 					    ctx->nft->debug_mask);
Signature · 1 line
2.35.1
author maintainer
#2 lore raw
Quoted 9 lines · Pablo Neira Ayuso
Quoted 2 lines · Florian Westphal

'rule inet dscpclassify dscp_match meta l4proto { udp } th dport { 3478 } th sport { 3478-3497, 16384-16387 } goto ct_set_ef' works with 'nft add', but not 'nft insert', the latter yields: "BUG: unhandled op 4".

That's my fault, thanks for the fix.

P.S: Please add a simple test for this regression.

Done.