Skip to content

Commit 3364d61

Browse files
Parthasarathy Bhuvaragandavem330
authored andcommitted
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: 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 b7d6df5 commit 3364d61

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
@@ -1083,7 +1083,7 @@ static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
10831083
}
10841084
} while (sent < dlen && !rc);
10851085

1086-
return rc ? rc : sent;
1086+
return sent ? sent : rc;
10871087
}
10881088

10891089
/**

0 commit comments

Comments
 (0)