From: Jan Engelhardt <jengelh@medozas.de>
To: kaber@trash.net
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 4/4] netfilter: xtables: collapse conditions in xt_ecn
Date: Thu, 9 Jun 2011 22:23:56 +0200 [thread overview]
Message-ID: <1307651037-20520-5-git-send-email-jengelh@medozas.de> (raw)
In-Reply-To: <1307651037-20520-1-git-send-email-jengelh@medozas.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
net/netfilter/xt_ecn.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/net/netfilter/xt_ecn.c b/net/netfilter/xt_ecn.c
index 6ccc35d..3c831a8 100644
--- a/net/netfilter/xt_ecn.c
+++ b/net/netfilter/xt_ecn.c
@@ -37,9 +37,8 @@ static bool match_tcp(const struct sk_buff *skb, struct xt_action_param *par)
* be good citizens.
*/
th = skb_header_pointer(skb, par->thoff, sizeof(_tcph), &_tcph);
- if (th == NULL) {
+ if (th == NULL)
return false;
- }
if (einfo->operation & XT_ECN_OP_MATCH_ECE) {
if (einfo->invert & XT_ECN_OP_MATCH_ECE) {
@@ -75,14 +74,12 @@ static bool ecn_mt4(const struct sk_buff *skb, struct xt_action_param *par)
{
const struct xt_ecn_info *info = par->matchinfo;
- if (info->operation & XT_ECN_OP_MATCH_IP)
- if (!match_ip(skb, info))
- return false;
+ if (info->operation & XT_ECN_OP_MATCH_IP && !match_ip(skb, info))
+ return false;
- if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR)) {
- if (!match_tcp(skb, par))
- return false;
- }
+ if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&
+ !match_tcp(skb, par))
+ return false;
return true;
}
--
1.7.3.4
next prev parent reply other threads:[~2011-06-09 20:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 20:23 xt_ecn in smaller pieces Jan Engelhardt
2011-06-09 20:23 ` [PATCH 1/4] netfilter: xtables: move ipt_ecn to xt_ecn Jan Engelhardt
2011-06-16 15:21 ` Patrick McHardy
2011-06-16 15:31 ` Jan Engelhardt
2011-06-16 15:34 ` Patrick McHardy
2011-06-16 15:43 ` Jan Engelhardt
2011-06-30 15:38 ` Jan Engelhardt
2011-06-30 16:35 ` Patrick McHardy
2011-06-09 20:23 ` [PATCH 2/4] netfilter: xtables: give xt_ecn its own name Jan Engelhardt
2011-06-09 20:23 ` [PATCH 3/4] netfilter: xtables: add an IPv6 capable version of the ECN match Jan Engelhardt
2011-06-09 20:23 ` Jan Engelhardt [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-12-27 15:27 xt_ecn revisited Jan Engelhardt
2011-12-27 15:28 ` [PATCH 4/4] netfilter: xtables: collapse conditions in xt_ecn Jan Engelhardt
2011-12-27 18:57 xt_ecn, with descriptions Jan Engelhardt
2011-12-27 18:57 ` [PATCH 4/4] netfilter: xtables: collapse conditions in xt_ecn Jan Engelhardt
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=1307651037-20520-5-git-send-email-jengelh@medozas.de \
--to=jengelh@medozas.de \
--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).