[PATCH nft 4/5] parser_bison: only reset by name is supported by now

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



NFT_MSG_GETSET does not support for handle lookup yet, restrict this to
reset by name by now.

Add a bogon test reported by Florian Westphal.

Fixes: 83e0f4402fb7 ("Implement 'reset {set,map,element}' commands")
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/parser_bison.y                                     | 4 ++--
 tests/shell/testcases/bogons/nft-f/null_set_name_crash | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
 create mode 100644 tests/shell/testcases/bogons/nft-f/null_set_name_crash

diff --git a/src/parser_bison.y b/src/parser_bison.y
index ed6a24a15377..87b34293d22c 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1757,11 +1757,11 @@ reset_cmd		:	COUNTERS	list_cmd_spec_any
 			{
 				$$ = cmd_alloc(CMD_RESET, CMD_OBJ_ELEMENTS, &$2, &@$, $3);
 			}
-			|	SET		set_or_id_spec
+			|	SET		set_spec
 			{
 				$$ = cmd_alloc(CMD_RESET, CMD_OBJ_SET, &$2, &@$, NULL);
 			}
-			|	MAP		set_or_id_spec
+			|	MAP		set_spec
 			{
 				$$ = cmd_alloc(CMD_RESET, CMD_OBJ_MAP, &$2, &@$, NULL);
 			}
diff --git a/tests/shell/testcases/bogons/nft-f/null_set_name_crash b/tests/shell/testcases/bogons/nft-f/null_set_name_crash
new file mode 100644
index 000000000000..e5d85b228a84
--- /dev/null
+++ b/tests/shell/testcases/bogons/nft-f/null_set_name_crash
@@ -0,0 +1,2 @@
+table y { }
+reset set y handle 6
-- 
2.30.2





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux