]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix socket flow control accounting error at tipc_recv_stream
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Mon, 24 Apr 2017 13:00:43 +0000 (15:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Apr 2017 15:45:38 +0000 (11:45 -0400)
commit4faedd4b47acf9ca731b41054f99e39f07f3a6a1
tree71f1dae3165074cbdea3147a6689a1900e0ce02f
parentff04cd2a5b8fd2d6d7f772fbdf43b0663ffacea7
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: 3fb555b39b71 ("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>
net/tipc/socket.c