Skip to contentSkip to conversation

netfilter: don't do window scaling for a picked up connection

PATCH In review Changli Gao 2 participants 3 messages Apr 1, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: don't do window scaling for a picked up connection

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.

---
 net/netfilter/nf_conntrack_proto_tcp.c |    1 -
 1 file changed, 1 deletion(-)
net/netfilter/nf_conntrack_proto_tcp.c +0 -1
index 361eade..22f0500 100644
@@ -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;
 			/*
#1 lore raw
Quoted 13 lines · 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.

---
 net/netfilter/nf_conntrack_proto_tcp.c |    1 -
 1 file changed, 1 deletion(-)
net/netfilter/nf_conntrack_proto_tcp.c +0 -0
index 361eade..22f0500 100644

net/netfilter/nf_conntrack_proto_tcp.c static bool tcp_in_window(const struct nf_conn *ct, · line 587

Quoted 4 lines
net/netfilter/nf_conntrack_proto_tcp.c +0 -1
@@ -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.

#2 lore raw
Quoted 3 lines · Pablo Neira Ayuso

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.

Signature · 2 lines
Regards,
Changli Gao([email protected])