From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net, bjornar.ness@gmail.com
Subject: [PATCH nft 2/2] parser: restore named vmap
Date: Sun, 23 Nov 2014 21:11:03 +0100 [thread overview]
Message-ID: <1416773463-8583-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1416773463-8583-1-git-send-email-pablo@netfilter.org>
For example:
nft add map filter my_vmap { type ipv4_addr : verdict\; }
nft add element filter my_vmap { 1.0.0.0 : drop}
nft add rule filter input ip saddr vmap @my_vmap
Reported-by: Bjørnar Ness <bjornar.ness@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/parser_bison.y | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 6eb0475..ad2951a 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1211,6 +1211,13 @@ verdict_map_expr : '{' verdict_map_list_expr '}'
$2->location = @$;
$$ = $2;
}
+ | AT identifier
+ {
+ $$ = symbol_expr_alloc(&@$, SYMBOL_SET,
+ current_scope(state),
+ $2);
+ xfree($2);
+ }
;
verdict_map_list_expr : verdict_map_list_member_expr
@@ -1691,6 +1698,10 @@ set_list_member_expr : opt_newline expr opt_newline
{
$$ = mapping_expr_alloc(&@$, $2, $4);
}
+ | opt_newline map_lhs_expr COLON verdict_expr opt_newline
+ {
+ $$ = mapping_expr_alloc(&@$, $2, $4);
+ }
;
initializer_expr : expr
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-11-23 20:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-23 20:11 [PATCH nft 1/2] src: restore nft --debug Pablo Neira Ayuso
2014-11-23 20:11 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416773463-8583-2-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=bjornar.ness@gmail.com \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).