Skip to content

Commit 05ff837

Browse files
Parthasarathy Bhuvaragandavem330
authored andcommitted
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: 10724cc ("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]>
1 parent 3364d61 commit 05ff837

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ static int tipc_recv_stream(struct socket *sock, struct msghdr *m,
14841484
if (unlikely(flags & MSG_PEEK))
14851485
goto exit;
14861486

1487-
tsk->rcv_unacked += tsk_inc(tsk, hlen + sz);
1487+
tsk->rcv_unacked += tsk_inc(tsk, hlen + msg_data_sz(msg));
14881488
if (unlikely(tsk->rcv_unacked >= (tsk->rcv_win / 4)))
14891489
tipc_sk_send_ack(tsk);
14901490
tsk_advance_rx_queue(sk);

0 commit comments

Comments
 (0)