From: Tomasz Bursztyka Date: Wed, 4 Sep 2013 09:50:21 +0000 (+0300) Subject: src: Add priority keyword on base chain description X-Git-Tag: v0.099~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=419968925d01571b2f454abb2b80a0f30b7f3227;p=thirdparty%2Fnftables.git src: Add priority keyword on base chain description 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 --- diff --git a/src/parser.y b/src/parser.y index ec78e7fd..a7dfdcc4 100644 --- a/src/parser.y +++ b/src/parser.y @@ -767,7 +767,7 @@ map_block : /* empty */ { $$ = $-1; } } ; -hook_spec : TYPE STRING HOOK STRING NUM +hook_spec : TYPE STRING HOOK STRING PRIORITY NUM { $0->type = $2; $0->hookstr = chain_hookname_lookup($4); @@ -776,10 +776,10 @@ hook_spec : TYPE STRING HOOK STRING NUM state->msgs); YYERROR; } - $0->priority = $5; + $0->priority = $6; $0->flags |= CHAIN_F_BASECHAIN; } - | TYPE STRING HOOK STRING DASH NUM + | TYPE STRING HOOK STRING PRIORITY DASH NUM { $0->type = $2; $0->hookstr = chain_hookname_lookup($4); @@ -788,7 +788,7 @@ hook_spec : TYPE STRING HOOK STRING NUM state->msgs); YYERROR; } - $0->priority = -$6; + $0->priority = -$7; $0->flags |= CHAIN_F_BASECHAIN; } ; diff --git a/src/rule.c b/src/rule.c index f493cd48..42ba37f4 100644 --- a/src/rule.c +++ b/src/rule.c @@ -295,7 +295,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->handle.family, chain->hooknum), chain->priority); }