]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix socket flow control accounting error at tipc_send_stream
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Mon, 24 Apr 2017 13:00:42 +0000 (15:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Apr 2017 15:45:37 +0000 (11:45 -0400)
commitff04cd2a5b8fd2d6d7f772fbdf43b0663ffacea7
tree123f0e5a701ba5d91c58a9c2c5e3e89fb4dcda19
parent76d5c5f237559fa9a8afe29c4efd87aa23c8dedb
tipc: fix socket flow control accounting error at tipc_send_stream

Until now in tipc_send_stream(), we return -1 when the socket
encounters link congestion even if the socket had successfully
sent partial data. This is incorrect as the application resends
the same the partial data leading to data corruption at
receiver's end.

In this commit, we return the partially sent bytes as the return
value at link congestion.

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