[nftables tool PATCH 3/5] syntax: Add priority keyword on base chain description

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

 



Instead of:
add chain foo bar { type route hook input 0; }

it should be now:
add chain foo bar { type route hook input priority 0; }

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@xxxxxxxxxxxxxxx>
---
 src/parser.y | 8 ++++----
 src/rule.c   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/parser.y b/src/parser.y
index 4df7d44..9a91490 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -765,11 +765,11 @@ map_block		:	/* empty */	{ $$ = $<set>-1; }
 			}
 			;
 
-hook_spec		:	TYPE		STRING		HOOK		STRING		NUM
+hook_spec		:	TYPE	STRING	HOOK	STRING	PRIORITY	NUM
 			{
 				$<chain>0->type		= $2;
 				$<chain>0->hooknum	= str2hooknum($4);
-				$<chain>0->priority	= $5;
+				$<chain>0->priority	= $6;
 				$<chain>0->flags	|= CHAIN_F_BASECHAIN;
 
 				if ($<chain>0->hooknum == HOOK_NUMHOOKS) {
@@ -778,11 +778,11 @@ hook_spec		:	TYPE		STRING		HOOK		STRING		NUM
 					YYERROR;	
 				}
 			}
-			|	TYPE		STRING		HOOK		STRING		DASH	NUM
+			|	TYPE	STRING	HOOK	STRING	PRIORITY	DASH	NUM
 			{
 				$<chain>0->type		= $2;
 				$<chain>0->hooknum	= str2hooknum($4);
-				$<chain>0->priority	= -$6;
+				$<chain>0->priority	= -$7;
 				$<chain>0->flags	|= CHAIN_F_BASECHAIN;
 
 				if ($<chain>0->hooknum == HOOK_NUMHOOKS) {
diff --git a/src/rule.c b/src/rule.c
index 23b64a7..28a52b0 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -262,7 +262,7 @@ static void chain_print(const struct chain *chain)
 
 	printf("\tchain %s {\n", chain->handle.chain);
 	if (chain->flags & CHAIN_F_BASECHAIN) {
-		printf("\t\t type %s hook %s %u;\n", chain->type,
+		printf("\t\t type %s hook %s priority %u;\n", chain->type,
 		       hooknum2str(chain->hooknum), chain->priority);
 	}
 	list_for_each_entry(rule, &chain->rules, list) {
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux