aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-07-09 19:07:35 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-12 02:06:14 -0400
commit9012de5089560136b849b920ad038b96160ed8f6 (patch)
tree20261a0c6e074ca936878835b64a04294ca3af52 /net/tipc/node.c
parente32f55f373217001187ff171e75c5dfbb251f633 (diff)
tipc: add sequence number check for link STATE messages
Some switch infrastructures produce huge amounts of packet duplicates. This becomes a problem if those messages are STATE/NACK protocol messages, causing unnecessary retransmissions of already accepted packets. We now introduce a unique sequence number per STATE protocol message so that duplicates can be identified and ignored. This will also be useful when tracing such cases, and to avert replay attacks when TIPC is encrypted. For compatibility reasons we have to introduce a new capability flag TIPC_LINK_PROTO_SEQNO to handle this new feature. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index cfdbaf479fd1..1cdb176798f7 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,
363{ 363{
364 struct tipc_net *tn = net_generic(net, tipc_net_id); 364 struct tipc_net *tn = net_generic(net, tipc_net_id);
365 struct tipc_node *n, *temp_node; 365 struct tipc_node *n, *temp_node;
366 struct tipc_link *l;
367 int bearer_id;
366 int i; 368 int i;
367 369
368 spin_lock_bh(&tn->node_list_lock); 370 spin_lock_bh(&tn->node_list_lock);
@@ -370,6 +372,11 @@ static struct tipc_node *tipc_node_create(struct net *net, u32 addr,
370 if (n) { 372 if (n) {
371 /* Same node may come back with new capabilities */ 373 /* Same node may come back with new capabilities */
372 n->capabilities = capabilities; 374 n->capabilities = capabilities;
375 for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) {
376 l = n->links[bearer_id].link;
377 if (l)
378 tipc_link_update_caps(l, capabilities);
379 }
373 goto exit; 380 goto exit;
374 } 381 }
375 n = kzalloc(sizeof(*n), GFP_ATOMIC); 382 n = kzalloc(sizeof(*n), GFP_ATOMIC);