netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: don't do window scaling for a picked up connection
@ 2012-04-01 15:04 Changli Gao
  2012-04-01 16:21 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Changli Gao @ 2012-04-01 15:04 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Patrick McHardy, David S. Miller, netfilter-devel, netdev,
	Changli Gao

For a picked up connection, the window scaling option is also lost, because this
option is only valid in SYN or SYN/ACK segments. We should remove the useless
expression to save the CPU power.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 net/netfilter/nf_conntrack_proto_tcp.c |    1 -
 1 file changed, 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 361eade..22f0500 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -584,7 +584,6 @@ static bool tcp_in_window(const struct nf_conn *ct,
 			 * Let's try to use the data from the packet.
 			 */
 			sender->td_end = end;
-			win <<= sender->td_scale;
 			sender->td_maxwin = (win == 0 ? 1 : win);
 			sender->td_maxend = end + sender->td_maxwin;
 			/*

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

* Re: [PATCH] netfilter: don't do window scaling for a picked up connection
  2012-04-01 15:04 [PATCH] netfilter: don't do window scaling for a picked up connection Changli Gao
@ 2012-04-01 16:21 ` Pablo Neira Ayuso
  2012-04-01 16:41   ` Changli Gao
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2012-04-01 16:21 UTC (permalink / raw)
  To: Changli Gao; +Cc: Patrick McHardy, David S. Miller, netfilter-devel, netdev

On Sun, Apr 01, 2012 at 11:04:43PM +0800, Changli Gao wrote:
> For a picked up connection, the window scaling option is also lost, because this
> option is only valid in SYN or SYN/ACK segments. We should remove the useless
> expression to save the CPU power.
> 
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ---
>  net/netfilter/nf_conntrack_proto_tcp.c |    1 -
>  1 file changed, 1 deletion(-)
> diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
> index 361eade..22f0500 100644
> --- a/net/netfilter/nf_conntrack_proto_tcp.c
> +++ b/net/netfilter/nf_conntrack_proto_tcp.c
> @@ -584,7 +584,6 @@ static bool tcp_in_window(const struct nf_conn *ct,
>  			 * Let's try to use the data from the packet.
>  			 */
>  			sender->td_end = end;
> -			win <<= sender->td_scale;

This breaks conntrackd and its ability to recover flows by injecting
the window scaling via ctnetlink.

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

* Re: [PATCH] netfilter: don't do window scaling for a picked up connection
  2012-04-01 16:21 ` Pablo Neira Ayuso
@ 2012-04-01 16:41   ` Changli Gao
  0 siblings, 0 replies; 3+ messages in thread
From: Changli Gao @ 2012-04-01 16:41 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Patrick McHardy, David S. Miller, netfilter-devel, netdev

On Mon, Apr 2, 2012 at 12:21 AM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> This breaks conntrackd and its ability to recover flows by injecting
> the window scaling via ctnetlink.

Got it. Thanks.

Just forget this patch. I'll post another patch to fix the duplicate
window scaling: one is here, and the other is before the state
updating code.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

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

end of thread, other threads:[~2012-04-01 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-01 15:04 [PATCH] netfilter: don't do window scaling for a picked up connection Changli Gao
2012-04-01 16:21 ` Pablo Neira Ayuso
2012-04-01 16:41   ` Changli Gao

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