Skip to content

Commit abc025d

Browse files
Parthasarathy Bhuvaragangregkh
authored andcommitted
tipc: fix random link resets while adding a second bearer
commit d2f394dc4816b7bd1b44981d83509f18f19c53f0 upstream. In a dual bearer configuration, if the second tipc link becomes active while the first link still has pending nametable "bulk" updates, it randomly leads to reset of the second link. When a link is established, the function named_distribute(), fills the skb based on node mtu (allows room for TUNNEL_PROTOCOL) with NAME_DISTRIBUTOR message for each PUBLICATION. However, the function named_distribute() allocates the buffer by increasing the node mtu by INT_H_SIZE (to insert NAME_DISTRIBUTOR). This consumes the space allocated for TUNNEL_PROTOCOL. When establishing the second link, the link shall tunnel all the messages in the first link queue including the "bulk" update. As size of the NAME_DISTRIBUTOR messages while tunnelling, exceeds the link mtu the transmission fails (-EMSGSIZE). Thus, the synch point based on the message count of the tunnel packets is never reached leading to link timeout. In this commit, we adjust the size of name distributor message so that they can be tunnelled. Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d39cb4a commit abc025d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

net/tipc/name_distr.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ static void publ_to_item(struct distr_item *i, struct publication *p)
6262

6363
/**
6464
* named_prepare_buf - allocate & initialize a publication message
65+
*
66+
* The buffer returned is of size INT_H_SIZE + payload size
6567
*/
6668
static struct sk_buff *named_prepare_buf(struct net *net, u32 type, u32 size,
6769
u32 dest)
@@ -166,9 +168,9 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,
166168
struct publication *publ;
167169
struct sk_buff *skb = NULL;
168170
struct distr_item *item = NULL;
169-
uint msg_dsz = (tipc_node_get_mtu(net, dnode, 0) / ITEM_SIZE) *
170-
ITEM_SIZE;
171-
uint msg_rem = msg_dsz;
171+
u32 msg_dsz = ((tipc_node_get_mtu(net, dnode, 0) - INT_H_SIZE) /
172+
ITEM_SIZE) * ITEM_SIZE;
173+
u32 msg_rem = msg_dsz;
172174

173175
list_for_each_entry(publ, pls, local_list) {
174176
/* Prepare next buffer: */

0 commit comments

Comments
 (0)