]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
netfilter: ipvs: don't check for presence of nat extension
authorFlorian Westphal <fw@strlen.de>
Tue, 28 Mar 2017 08:31:20 +0000 (10:31 +0200)
committerSimon Horman <horms@verge.net.au>
Thu, 30 Mar 2017 12:41:42 +0000 (14:41 +0200)
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

index d30c327bb578981c0868086cfddb6c304419b2e8..2e2bf7428cd152aa37afe39b1c80389339abb746 100644 (file)
@@ -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,