From e4767262deb1485598a77c9933b0af9de757343b Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Wed, 19 Sep 2012 09:40:00 +0000 Subject: [PATCH] --- yaml --- r: 323086 b: refs/heads/master c: bc26ccd8fc756749de95606d28314efd0ce5aec3 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ipv4/tcp.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 8c5341696548..24fe39963cfe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8ea853fd0b721f14eacff1a5b364fe3e60d2dd82 +refs/heads/master: bc26ccd8fc756749de95606d28314efd0ce5aec3 diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index bf9a8ab29459..5f6419341821 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -2331,10 +2331,17 @@ static int tcp_repair_options_est(struct tcp_sock *tp, tp->rx_opt.mss_clamp = opt.opt_val; break; case TCPOPT_WINDOW: - if (opt.opt_val > 14) - return -EFBIG; + { + u16 snd_wscale = opt.opt_val & 0xFFFF; + u16 rcv_wscale = opt.opt_val >> 16; + + if (snd_wscale > 14 || rcv_wscale > 14) + return -EFBIG; - tp->rx_opt.snd_wscale = opt.opt_val; + tp->rx_opt.snd_wscale = snd_wscale; + tp->rx_opt.rcv_wscale = rcv_wscale; + tp->rx_opt.wscale_ok = 1; + } break; case TCPOPT_SACK_PERM: if (opt.opt_val != 0)