diff options
author | Florian Westphal <fw@strlen.de> | 2017-03-28 10:31:20 +0200 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2017-03-30 14:41:42 +0200 |
commit | 41390895e50bc4f28abe384c6b35ac27464a20ec (patch) | |
tree | 360154b271294bcd98ab4055620c01e0b52109a5 /net/netfilter/ipvs | |
parent | 592d42ac7fd36408979e09bf2f170f2595dab7b8 (diff) | |
download | lwn-41390895e50bc4f28abe384c6b35ac27464a20ec.tar.gz lwn-41390895e50bc4f28abe384c6b35ac27464a20ec.zip |
netfilter: ipvs: don't check for presence of nat extension
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>
Diffstat (limited to 'net/netfilter/ipvs')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ftp.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |