netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next] netfilter: ipvs: don't check for presence of nat extension
@ 2017-03-28  8:31 Florian Westphal
  2017-03-30 12:42 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2017-03-28  8:31 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

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.10.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nf-next] netfilter: ipvs: don't check for presence of nat extension
  2017-03-28  8:31 [PATCH nf-next] netfilter: ipvs: don't check for presence of nat extension Florian Westphal
@ 2017-03-30 12:42 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2017-03-30 12:42 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

On Tue, Mar 28, 2017 at 10:31:20AM +0200, Florian Westphal wrote:
> 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>

Thanks, applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-30 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28  8:31 [PATCH nf-next] netfilter: ipvs: don't check for presence of nat extension Florian Westphal
2017-03-30 12:42 ` Simon Horman

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).