diff options
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 72ea4752f21b..f32c02e2a543 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1738,8 +1738,14 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1738 | } | 1738 | } |
1739 | 1739 | ||
1740 | #ifdef CONFIG_NET_DMA | 1740 | #ifdef CONFIG_NET_DMA |
1741 | if (tp->ucopy.dma_chan) | 1741 | if (tp->ucopy.dma_chan) { |
1742 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | 1742 | if (tp->rcv_wnd == 0 && |
1743 | !skb_queue_empty(&sk->sk_async_wait_queue)) { | ||
1744 | tcp_service_net_dma(sk, true); | ||
1745 | tcp_cleanup_rbuf(sk, copied); | ||
1746 | } else | ||
1747 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
1748 | } | ||
1743 | #endif | 1749 | #endif |
1744 | if (copied >= target) { | 1750 | if (copied >= target) { |
1745 | /* Do not sleep, just process backlog. */ | 1751 | /* Do not sleep, just process backlog. */ |
@@ -2320,10 +2326,17 @@ static int tcp_repair_options_est(struct tcp_sock *tp, | |||
2320 | tp->rx_opt.mss_clamp = opt.opt_val; | 2326 | tp->rx_opt.mss_clamp = opt.opt_val; |
2321 | break; | 2327 | break; |
2322 | case TCPOPT_WINDOW: | 2328 | case TCPOPT_WINDOW: |
2323 | if (opt.opt_val > 14) | 2329 | { |
2324 | return -EFBIG; | 2330 | u16 snd_wscale = opt.opt_val & 0xFFFF; |
2331 | u16 rcv_wscale = opt.opt_val >> 16; | ||
2332 | |||
2333 | if (snd_wscale > 14 || rcv_wscale > 14) | ||
2334 | return -EFBIG; | ||
2325 | 2335 | ||
2326 | tp->rx_opt.snd_wscale = opt.opt_val; | 2336 | tp->rx_opt.snd_wscale = snd_wscale; |
2337 | tp->rx_opt.rcv_wscale = rcv_wscale; | ||
2338 | tp->rx_opt.wscale_ok = 1; | ||
2339 | } | ||
2327 | break; | 2340 | break; |
2328 | case TCPOPT_SACK_PERM: | 2341 | case TCPOPT_SACK_PERM: |
2329 | if (opt.opt_val != 0) | 2342 | if (opt.opt_val != 0) |