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:11:14 +0000
commita4da57bde3330aa2d84815e16d8cf238cebf8d70 (patch)
tree26396c1eb62d691bebea29dfc5a8353a75524760 /src/meta.c
parente71137847f6f1220abfb418590b2a8b1847fc4c6 (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>
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 6d425255..098728bb 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -335,7 +335,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)