summaryrefslogtreecommitdiffstats
path: root/src/meta.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-15 07:35:20 +0000
committerPatrick McHardy <kaber@trash.net>2014-01-15 11:52:50 +0000
commit24879f1173e5778cc76507ae17df0cadb78e21a0 (patch)
tree25cbed864ca260385c9a95d088dbb186c6d40465 /src/meta.c
parent76482c13d0d04759e2982578a5477ef6fd180d90 (diff)
meta: don't require "meta" keyword for a subset of meta expressions
Don't require the meta keyword for mark, iif, oif, iifname, oifname, skuid, skgid, nftrace, rtclassid and secmark. The protocol and length types still need the meta keyword to avoid grammar conflicts. Signed-off-by: Patrick McHardy <kaber@trash.net> Conflicts: src/parser.y
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/meta.c b/src/meta.c
index 3d84c509..063e641e 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -331,7 +331,18 @@ static const struct meta_template meta_templates[] = {
static void meta_expr_print(const struct expr *expr)
{
- printf("meta %s", meta_templates[expr->meta.key].token);
+ switch (expr->meta.key) {
+ case NFT_META_LEN:
+ case NFT_META_NFPROTO:
+ case NFT_META_L4PROTO:
+ case NFT_META_PROTOCOL:
+ case NFT_META_PRIORITY:
+ printf("meta %s", meta_templates[expr->meta.key].token);
+ break;
+ default:
+ printf("%s", meta_templates[expr->meta.key].token);
+ break;
+ }
}
static void meta_expr_clone(struct expr *new, const struct expr *expr)