From e121e75ff43c7a433271a267642e87ab1df36aa5 Mon Sep 17 00:00:00 2001 From: Kevin Lahey Date: Mon, 27 Oct 2003 16:38:12 -0800 Subject: [PATCH] [TCP]: When SYN is set, the window is not scaled. --- net/ipv4/tcp_input.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index c1e2c3e3e5dc7..5f446e0c6242a 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1967,7 +1967,10 @@ static int tcp_ack_update_window(struct sock *sk, struct tcp_opt *tp, struct sk_buff *skb, u32 ack, u32 ack_seq) { int flag = 0; - u32 nwin = ntohs(skb->h.th->window) << tp->snd_wscale; + u32 nwin = ntohs(skb->h.th->window); + + if (likely(!skb->h.th->syn)) + nwin <<= tp->snd_wscale; if (tcp_may_update_window(tp, ack, ack_seq, nwin)) { flag |= FLAG_WIN_UPDATE; -- 2.53.0