diff options
| author | Parthasarathy Bhuvaragan <[email protected]> | 2017-04-24 13:00:43 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-04-25 15:45:38 +0000 |
| commit | 05ff8378975a9d5fdde19104b62163d2902926fb (patch) | |
| tree | 71f1dae3165074cbdea3147a6689a1900e0ce02f /net/tipc/socket.c | |
| parent | tipc: fix socket flow control accounting error at tipc_send_stream (diff) | |
| download | kernel-05ff8378975a9d5fdde19104b62163d2902926fb.tar.gz kernel-05ff8378975a9d5fdde19104b62163d2902926fb.zip | |
tipc: fix socket flow control accounting error at tipc_recv_stream
Until now in tipc_recv_stream(), we update the received
unacknowledged bytes based on a stack variable and not based on the
actual message size.
If the user buffer passed at tipc_recv_stream() is smaller than the
received skb, the size variable in stack differs from the actual
message size in the skb. This leads to a flow control accounting
error causing permanent congestion.
In this commit, we fix this accounting error by always using the
size of the incoming message.
Fixes: 10724cc7bb78 ("tipc: redesign connection-level flow control")
Signed-off-by: Parthasarathy Bhuvaragan <[email protected]>
Reviewed-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/tipc/socket.c')
| -rw-r--r-- | net/tipc/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index b28e94f1c739..566906795c8c 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1484,7 +1484,7 @@ restart: if (unlikely(flags & MSG_PEEK)) goto exit; - tsk->rcv_unacked += tsk_inc(tsk, hlen + sz); + tsk->rcv_unacked += tsk_inc(tsk, hlen + msg_data_sz(msg)); if (unlikely(tsk->rcv_unacked >= (tsk->rcv_win / 4))) tipc_sk_send_ack(tsk); tsk_advance_rx_queue(sk); |
