diff options
author | David S. Miller <davem@davemloft.net> | 2018-07-11 23:06:14 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-11 23:06:14 -0700 |
commit | 0e97c4fb180ce90406e597a0a3f882c99ee55785 (patch) | |
tree | 906e6081a486ba6f244a8c0bb6d7c51c6343423d /net/tipc/node.c | |
parent | e32f55f373217001187ff171e75c5dfbb251f633 (diff) | |
parent | 7ea817f4e8322fa27fb860d15025bf72f68b179f (diff) |
Merge branch 'tipc-make-link-protocol-more-resilient'
Jon Maloy says:
====================
tipc: make link protocol more resilient
These two commits make the link ptotocol more resilient to
infrastructures with frequent packet duplication and long delays.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index cfdbaf479fd1..52fd80b0e728 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -363,6 +363,8 @@ static struct tipc_node *tipc_node_create(struct net *net, u32 addr, { struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_node *n, *temp_node; + struct tipc_link *l; + int bearer_id; int i; spin_lock_bh(&tn->node_list_lock); @@ -370,6 +372,11 @@ static struct tipc_node *tipc_node_create(struct net *net, u32 addr, if (n) { /* Same node may come back with new capabilities */ n->capabilities = capabilities; + for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) { + l = n->links[bearer_id].link; + if (l) + tipc_link_update_caps(l, capabilities); + } goto exit; } n = kzalloc(sizeof(*n), GFP_ATOMIC); @@ -1533,7 +1540,7 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id * tipc_node_check_state - check and if necessary update node state * @skb: TIPC packet * @bearer_id: identity of bearer delivering the packet - * Returns true if state is ok, otherwise consumes buffer and returns false + * Returns true if state and msg are ok, otherwise false */ static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb, int bearer_id, struct sk_buff_head *xmitq) @@ -1567,6 +1574,9 @@ static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb, } } + if (!tipc_link_validate_msg(l, hdr)) + return false; + /* Check and update node accesibility if applicable */ if (state == SELF_UP_PEER_COMING) { if (!tipc_link_is_up(l)) |