aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/name_table.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2012-04-17 17:57:52 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-04-19 15:46:36 -0400
commit1110b8d33a54d1b91131e2a70ef0c3c26425b800 (patch)
tree09563eeba21cc7f816f89101e1b345bcd4316262 /net/tipc/name_table.c
parenta909804f7c6cb83b7365ed23e9fd4c1267ee9ef0 (diff)
tipc: Update node-scope publications when network address is assigned
Ensures that node-scope name publications that exist prior to the configuration of a node's network address are properly re-initialized with that address when it is assigned. TIPC's node-scope publications are now tracked using a publications list like the lists used for cluster-scope and zone-scope publications so they can be easily updated when required. The inclusion of node scope name publications in a conventional publication list means that they must now also be withdrawn, just like cluster and zone scope publications are currently withdrawn. So some conditional tests on scope ==/!= TIPC_NODE_SCOPE are inserted/removed accordingly. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r--net/tipc/name_table.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index c6a1ae36952e..bd80d80fb112 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -698,7 +698,7 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
698 table.local_publ_count++; 698 table.local_publ_count++;
699 publ = tipc_nametbl_insert_publ(type, lower, upper, scope, 699 publ = tipc_nametbl_insert_publ(type, lower, upper, scope,
700 tipc_own_addr, port_ref, key); 700 tipc_own_addr, port_ref, key);
701 if (publ && (scope != TIPC_NODE_SCOPE)) 701 if (likely(publ))
702 tipc_named_publish(publ); 702 tipc_named_publish(publ);
703 write_unlock_bh(&tipc_nametbl_lock); 703 write_unlock_bh(&tipc_nametbl_lock);
704 return publ; 704 return publ;
@@ -716,8 +716,7 @@ int tipc_nametbl_withdraw(u32 type, u32 lower, u32 ref, u32 key)
716 publ = tipc_nametbl_remove_publ(type, lower, tipc_own_addr, ref, key); 716 publ = tipc_nametbl_remove_publ(type, lower, tipc_own_addr, ref, key);
717 if (likely(publ)) { 717 if (likely(publ)) {
718 table.local_publ_count--; 718 table.local_publ_count--;
719 if (publ->scope != TIPC_NODE_SCOPE) 719 tipc_named_withdraw(publ);
720 tipc_named_withdraw(publ);
721 write_unlock_bh(&tipc_nametbl_lock); 720 write_unlock_bh(&tipc_nametbl_lock);
722 list_del_init(&publ->pport_list); 721 list_del_init(&publ->pport_list);
723 kfree(publ); 722 kfree(publ);