Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: SYNPROXY: fix sending window update to client

Upon receipt of SYNACK from the server, ipt_SYNPROXY first sends back an ACK to
finish the server handshake, then calls nf_ct_seqadj_init() to initiate
sequence number adjustment of forwarded packets to the client and finally sends
a window update to the client to unblock it's TX queue.

Since synproxy_send_client_ack() does not set synproxy_send_tcp()'s nfct
parameter, no sequence number adjustment happens and the client receives the
window update with incorrect sequence number. Depending on client TCP
implementation, this leads to a significant delay (until a window probe is
being sent).

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Phil Sutter and committed by
Pablo Neira Ayuso
3c16241c 96fffb4f

+4 -2
+2 -1
net/ipv4/netfilter/ipt_SYNPROXY.c
··· 226 226 227 227 synproxy_build_options(nth, opts); 228 228 229 - synproxy_send_tcp(skb, nskb, NULL, 0, niph, nth, tcp_hdr_size); 229 + synproxy_send_tcp(skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY, 230 + niph, nth, tcp_hdr_size); 230 231 } 231 232 232 233 static bool
+2 -1
net/ipv6/netfilter/ip6t_SYNPROXY.c
··· 243 243 244 244 synproxy_build_options(nth, opts); 245 245 246 - synproxy_send_tcp(snet, skb, nskb, NULL, 0, niph, nth, tcp_hdr_size); 246 + synproxy_send_tcp(snet, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY, 247 + niph, nth, tcp_hdr_size); 247 248 } 248 249 249 250 static bool