From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: fw@strlen.de, netfilter-devel@vger.kernel.org
Subject: [PATCH 1/4] evaluate: use flagcmp for single RHS bitmask expression
Date: Mon, 17 Feb 2014 17:20:49 +0000 [thread overview]
Message-ID: <1392657652-9815-2-git-send-email-kaber@trash.net> (raw)
In-Reply-To: <1392657652-9815-1-git-send-email-kaber@trash.net>
Always use flagcmp for RHS bitmask expressions, independant of whether
only one or an entire list of bitmask expression is specified.
This makes sure that f.i. "tcp flags ack" will match any combinations
of ACK instead of ACK and only ACK.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
src/evaluate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/evaluate.c b/src/evaluate.c
index 8e51a63..f10d0d9 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -885,7 +885,11 @@ static int expr_evaluate_relational(struct eval_ctx *ctx, struct expr **expr)
rel->op = OP_FLAGCMP;
break;
default:
- rel->op = OP_EQ;
+ if (right->dtype->basetype != NULL &&
+ right->dtype->basetype->type == TYPE_BITMASK)
+ rel->op = OP_FLAGCMP;
+ else
+ rel->op = OP_EQ;
break;
}
}
--
1.8.5.3
next prev parent reply other threads:[~2014-02-17 17:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 17:20 [PATCH 0/4] nftables: bitmask and prefix fixes Patrick McHardy
2014-02-17 17:20 ` Patrick McHardy [this message]
2014-02-17 17:20 ` [PATCH 2/4] binop: take care of operator precedence when printing binop arguments Patrick McHardy
2014-02-17 17:20 ` [PATCH 3/4] netlink_delinarize: convert *all* bitmask values into individual bit values Patrick McHardy
2014-02-17 17:20 ` [PATCH 4/4] netlink: fix prefix expression handling Patrick McHardy
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=1392657652-9815-2-git-send-email-kaber@trash.net \
--to=kaber@trash.net \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).