Skip to contentSkip to conversation

cache: fetch more objects when resetting rule

PATCH New Pablo Neira Ayuso 1 participant 2 messages Mar 1, 2023 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/2 cache: fetch more objects when resetting rule

If the ruleset contains a reference to object, listing fails. The existing test for the new reset command displays the following error:

 # ./run-tests.sh testcases/rule_management/0011reset_0
 I: using nft command: ./../../src/nft

W: [FAILED] testcases/rule_management/0011reset_0: got 2
loading ruleset
resetting specific rule
netlink: Error: Unknown set 's' in dynset statement

---
 src/cache.c | 1 +
 1 file changed, 1 insertion(+)
src/cache.c +1 -0
index 38bc219abc57..95adee7f8ac1 100644
@@ -268,6 +268,7 @@ static unsigned int evaluate_cache_reset(struct cmd *cmd, unsigned int flags,
 {
 	switch (cmd->obj) {
 	case CMD_OBJ_RULES:
+	case CMD_OBJ_RULE:
 		if (filter) {
 			if (cmd->handle.table.name) {
 				filter->list.family = cmd->handle.family;
Signature · 1 line
2.30.2
author maintainer
#1 lore raw

PATCH 2/2 tests: shell: use bash in 0011reset_0

One of my boxes does not use bash as /bin/sh, update this test to explicitly use bash, otherwise I hit:

testcases/rule_management/0011reset_0: 71: Syntax error: "(" unexpected

Fixes 1694df2de79f ("Implement 'reset rule' and 'reset rules' commands")
---
 tests/shell/testcases/rule_management/0011reset_0 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/rule_management/0011reset_0 +1 -1
index 1a28b49fa8a7..8d2307964c37 100755
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 
Signature · 1 line
2.30.2