[PATCH 1/3] netfilter: ipvs: don't check for presence of nat extension

To: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Subject: [PATCH 1/3] netfilter: ipvs: don't check for presence of nat extension
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Florian Westphal <fw@xxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 10 Apr 2017 09:58:33 -0700
From: Florian Westphal <fw@xxxxxxxxx>

Check for the NAT status bits, they are set once conntrack needs NAT in source 
reply direction, this is slightly faster than nfct_nat() as that has to check 
extension area.

Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
 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 & 
                        /* If mangling fails this function will return 0
                         * which will cause the packet to be dropped.
                         * Mangling can only fail under memory pressure,

To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

<Prev in Thread] Current Thread [Next in Thread>