summaryrefslogtreecommitdiffstats
path: root/net/tipc/name_distr.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_distr.c
parenta909804f7c6cb83b7365ed23e9fd4c1267ee9ef0 (diff)
downloadlinux-1110b8d33a54d1b91131e2a70ef0c3c26425b800.tar.bz2
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_distr.c')
-rw-r--r--net/tipc/name_distr.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 8751ea53dfde..211c1723a190 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -160,6 +160,9 @@ void tipc_named_publish(struct publication *publ)
list_add_tail(&publ->local_list, &publ_lists[publ->scope]->list);
publ_lists[publ->scope]->size++;
+ if (publ->scope == TIPC_NODE_SCOPE)
+ return;
+
buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
if (!buf) {
warn("Publication distribution failure\n");
@@ -183,6 +186,9 @@ void tipc_named_withdraw(struct publication *publ)
list_del(&publ->local_list);
publ_lists[publ->scope]->size--;
+ if (publ->scope == TIPC_NODE_SCOPE)
+ return;
+
buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0);
if (!buf) {
warn("Withdrawal distribution failure\n");
@@ -349,11 +355,11 @@ void tipc_named_recv(struct sk_buff *buf)
}
/**
- * tipc_named_reinit - re-initialize local publication list
+ * tipc_named_reinit - re-initialize local publications
*
* This routine is called whenever TIPC networking is enabled.
- * All existing publications by this node that have "cluster" or "zone" scope
- * are updated to reflect the node's new network address.
+ * All name table entries published by this node are updated to reflect
+ * the node's new network address.
*/
void tipc_named_reinit(void)
@@ -363,7 +369,7 @@ void tipc_named_reinit(void)
write_lock_bh(&tipc_nametbl_lock);
- for (scope = TIPC_ZONE_SCOPE; scope <= TIPC_CLUSTER_SCOPE; scope++)
+ for (scope = TIPC_ZONE_SCOPE; scope <= TIPC_NODE_SCOPE; scope++)
list_for_each_entry(publ, &publ_lists[scope]->list, local_list)
publ->node = tipc_own_addr;