From 6f137a2db3419e961e41eda28668cd99e8a3f2e2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 24 Nov 2015 21:26:27 +0100 Subject: src: add fwd statement for netdev This patch add support for the forward statement, only available at the netdev family. # nft add table netdev filter # nft add chain netdev filter ingress { type filter hook ingress device eth0 priority 0\; } # nft add rule netdev filter ingress fwd to dummy0 Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 514dd7eb..05ade0fa 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -398,7 +398,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %token FANOUT "fanout" %token DUP "dup" -%token ON "on" +%token FWD "fwd" %token POSITION "position" %token COMMENT "comment" @@ -471,6 +471,8 @@ static void location_update(struct location *loc, struct location *rhs, int n) %type queue_stmt_flags queue_stmt_flag %type dup_stmt %destructor { stmt_free($$); } dup_stmt +%type fwd_stmt +%destructor { stmt_free($$); } fwd_stmt %type set_stmt %destructor { stmt_free($$); } set_stmt %type set_stmt_op @@ -1337,6 +1339,7 @@ stmt : verdict_stmt | masq_stmt | redir_stmt | dup_stmt + | fwd_stmt | set_stmt ; @@ -1687,6 +1690,13 @@ dup_stmt : DUP TO stmt_expr } ; +fwd_stmt : FWD TO expr + { + $$ = fwd_stmt_alloc(&@$); + $$->fwd.to = $3; + } + ; + nf_nat_flags : nf_nat_flag | nf_nat_flags COMMA nf_nat_flag { -- cgit v1.2.3