aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>2018-09-25 12:21:58 -0400
committerDavid S. Miller <davem@davemloft.net>2018-09-25 13:47:37 -0400
commit92ef12b32feab8f277b69e9fb89ede2796777f4d (patch)
treeedbb2cc31d9e57b760b5f39c947f3d01a5476c5c /net/tipc
parent2e9361efa707e186d91b938e44f9e326725259f7 (diff)
tipc: fix flow control accounting for implicit connect
In the case of implicit connect message with data > 1K, the flow control accounting is incorrect. At this state, the socket does not know the peer nodes capability and falls back to legacy flow control by return 1, however the receiver of this message will perform the new block accounting. This leads to a slack and eventually traffic disturbance. In this commit, we perform tipc_node_get_capabilities() at implicit connect and perform accounting based on the peer's capability. Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> Signed-off-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3f03ddd0e35b..b6f99b021d09 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1419,8 +1419,10 @@ static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
1419 /* Handle implicit connection setup */ 1419 /* Handle implicit connection setup */
1420 if (unlikely(dest)) { 1420 if (unlikely(dest)) {
1421 rc = __tipc_sendmsg(sock, m, dlen); 1421 rc = __tipc_sendmsg(sock, m, dlen);
1422 if (dlen && (dlen == rc)) 1422 if (dlen && dlen == rc) {
1423 tsk->peer_caps = tipc_node_get_capabilities(net, dnode);
1423 tsk->snt_unacked = tsk_inc(tsk, dlen + msg_hdr_sz(hdr)); 1424 tsk->snt_unacked = tsk_inc(tsk, dlen + msg_hdr_sz(hdr));
1425 }
1424 return rc; 1426 return rc;
1425 } 1427 }
1426 1428