mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 16:44:10 +08:00
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: 10724cc7bb
("tipc: redesign connection-level flow control")
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3364d61c92
commit
05ff837897
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user