Skip to content

Commit 4139089

Browse files
Florian Westphalhorms
authored andcommitted
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>
1 parent 592d42a commit 4139089

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/ipvs/ip_vs_ftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
260260
buf_len = strlen(buf);
261261

262262
ct = nf_ct_get(skb, &ctinfo);
263-
if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
263+
if (ct && !nf_ct_is_untracked(ct) && (ct->status & IPS_NAT_MASK)) {
264264
/* If mangling fails this function will return 0
265265
* which will cause the packet to be dropped.
266266
* Mangling can only fail under memory pressure,

0 commit comments

Comments
 (0)