From: Simon Horman <horms@verge.net.au>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org,
Wensong Zhang <wensong@linux-vs.org>,
Julian Anastasov <ja@ssi.bg>, Florian Westphal <fw@strlen.de>
Subject: [PATCH 1/3] netfilter: ipvs: don't check for presence of nat extension
Date: Mon, 10 Apr 2017 09:58:33 -0700 [thread overview]
Message-ID: <1491843515-1627-2-git-send-email-horms@verge.net.au> (raw)
In-Reply-To: <1491843515-1627-1-git-send-email-horms@verge.net.au>
From: Florian Westphal <fw@strlen.de>
Check for the NAT status bits, they are set once conntrack needs NAT in source or
reply direction, this is slightly faster than nfct_nat() as that has to check the
extension area.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
net/netfilter/ipvs/ip_vs_ftp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index d30c327bb578..2e2bf7428cd1 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -260,7 +260,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
buf_len = strlen(buf);
ct = nf_ct_get(skb, &ctinfo);
- if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
+ if (ct && !nf_ct_is_untracked(ct) && (ct->status & IPS_NAT_MASK)) {
/* If mangling fails this function will return 0
* which will cause the packet to be dropped.
* Mangling can only fail under memory pressure,
--
2.7.0.rc3.207.g0ac5344
next prev parent reply other threads:[~2017-04-10 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-10 16:58 [GIT 0/3] Second Round of IPVS Updates for v4.12 Simon Horman
2017-04-10 16:58 ` Simon Horman [this message]
2017-04-10 16:58 ` [PATCH 2/3] netfilter: ipvs: Replace kzalloc with kcalloc Simon Horman
2017-04-10 16:58 ` [PATCH 3/3] ipvs: remove unused variable Simon Horman
2017-04-13 23:01 ` [GIT 0/3] Second Round of IPVS Updates for v4.12 Pablo Neira Ayuso
2017-04-13 23:51 ` Simon Horman
2017-04-14 0:06 ` Pablo Neira Ayuso
2017-04-15 8:59 ` Pablo Neira Ayuso
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=1491843515-1627-2-git-send-email-horms@verge.net.au \
--to=horms@verge.net.au \
--cc=fw@strlen.de \
--cc=ja@ssi.bg \
--cc=lvs-devel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=wensong@linux-vs.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).