diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2010-08-17 11:00:16 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 17:32:00 -0700 |
commit | 5a68d5ee000bb784c4856391b4861739c8bbd341 (patch) | |
tree | bf00540edd8adae24f3805b08d53ba37af6366d7 /net/tipc/node.c | |
parent | 564e83b51a12b794e3f63a2d872398e1ee21616f (diff) |
tipc: Prevent missing name table entries when link flip-flops rapidly
Ensure that TIPC does not re-establish communication with a
neighboring node until it has finished updating all data structures
containing information about that node to reflect the earlier loss of
contact. Previously, it was possible for TIPC to perform its purge of
name table entries relating to the node once contact had already been
re-established, resulting in the unwanted removal of valid name table
entries.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 940851797615..b702c7bf580f 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -383,6 +383,20 @@ static void node_established_contact(struct tipc_node *n_ptr) tipc_highest_allowed_slave); } +static void node_cleanup_finished(unsigned long node_addr) +{ + struct tipc_node *n_ptr; + + read_lock_bh(&tipc_net_lock); + n_ptr = tipc_node_find(node_addr); + if (n_ptr) { + tipc_node_lock(n_ptr); + n_ptr->cleanup_required = 0; + tipc_node_unlock(n_ptr); + } + read_unlock_bh(&tipc_net_lock); +} + static void node_lost_contact(struct tipc_node *n_ptr) { struct cluster *c_ptr; @@ -457,6 +471,11 @@ static void node_lost_contact(struct tipc_node *n_ptr) tipc_k_signal((Handler)ns->handle_node_down, (unsigned long)ns->usr_handle); } + + /* Prevent re-contact with node until all cleanup is done */ + + n_ptr->cleanup_required = 1; + tipc_k_signal((Handler)node_cleanup_finished, n_ptr->addr); } /** |