netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft 1/2] cache: fetch more objects when resetting rule
@ 2023-03-01 11:05 Pablo Neira Ayuso
  2023-03-01 11:05 ` [PATCH nft 2/2] tests: shell: use bash in 0011reset_0 Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2023-03-01 11:05 UTC (permalink / raw)
  To: netfilter-devel; +Cc: phil

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

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/cache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cache.c b/src/cache.c
index 38bc219abc57..95adee7f8ac1 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -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;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH nft 2/2] tests: shell: use bash in 0011reset_0
  2023-03-01 11:05 [PATCH nft 1/2] cache: fetch more objects when resetting rule Pablo Neira Ayuso
@ 2023-03-01 11:05 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2023-03-01 11:05 UTC (permalink / raw)
  To: netfilter-devel; +Cc: phil

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")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/shell/testcases/rule_management/0011reset_0 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shell/testcases/rule_management/0011reset_0 b/tests/shell/testcases/rule_management/0011reset_0
index 1a28b49fa8a7..8d2307964c37 100755
--- a/tests/shell/testcases/rule_management/0011reset_0
+++ b/tests/shell/testcases/rule_management/0011reset_0
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-01 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 11:05 [PATCH nft 1/2] cache: fetch more objects when resetting rule Pablo Neira Ayuso
2023-03-01 11:05 ` [PATCH nft 2/2] tests: shell: use bash in 0011reset_0 Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).