aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>2017-04-24 15:00:42 +0200
committerDavid S. Miller <davem@davemloft.net>2017-04-25 11:45:37 -0400
commit3364d61c92ecca7a8da990659c4b0ae1fcf0fcfb (patch)
tree123f0e5a701ba5d91c58a9c2c5e3e89fb4dcda19 /net/tipc
parentipv6: move stub initialization after ipv6 setup completion (diff)
downloadlinux-dev-3364d61c92ecca7a8da990659c4b0ae1fcf0fcfb.tar.xz
linux-dev-3364d61c92ecca7a8da990659c4b0ae1fcf0fcfb.zip
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: 10724cc7bb78 ("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>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 7130e73bd42c..b28e94f1c739 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1083,7 +1083,7 @@ static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
}
} while (sent < dlen && !rc);
- return rc ? rc : sent;
+ return sent ? sent : rc;
}
/**