> -----Original Message-----
> From: Parthasarathy Bhuvaragan
> Sent: Monday, March 20, 2017 05:10 AM
> To: tipc-discussion@lists.sourceforge.net; Jon Maloy
> <jon.ma...@ericsson.com>; Ying Xue <ying....@windriver.com>
> Subject: [PATCH net v1 3/7] 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 an accounting error 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.
> 
> Fixes: 10724cc7bb78 ("tipc: redesign connection-level flow control")
> Signed-off-by: Parthasarathy Bhuvaragan
> <parthasarathy.bhuvara...@ericsson.com>
> ---
>  net/tipc/socket.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c index
> 566906795c8c..2c2ea2e15c45 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -1054,8 +1054,11 @@ static int __tipc_sendstream(struct socket *sock,
> struct msghdr *m, size_t dlen)
>       /* Handle implicit connection setup */
>       if (unlikely(dest)) {
>               rc = __tipc_sendmsg(sock, m, dlen);
> -             if (dlen && (dlen == rc))
> +             if (dlen && (dlen == rc)) {
> +                     dnode = dest->addr.id.node;

This is not correct. 'dest' may quite well be a struct tipc_portname, which 
will be translated during the _tipc_sendmsg() call, and set the socket's peer 
node field.
So, the right thing to do here is:

                                           dnode = tsk_peer_node(tsk);

This works even if 'dest'is a struct tipc_portid.

///jon


> +                     tsk->peer_caps = tipc_node_get_capabilities(net,
> dnode);
>                       tsk->snt_unacked = tsk_inc(tsk, dlen +
> msg_hdr_sz(hdr));
> +             }
>               return rc;
>       }
> 
> --
> 2.1.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to