aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/name_distr.c14
-rw-r--r--net/tipc/name_table.c5
2 files changed, 12 insertions, 7 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)
160 list_add_tail(&publ->local_list, &publ_lists[publ->scope]->list); 160 list_add_tail(&publ->local_list, &publ_lists[publ->scope]->list);
161 publ_lists[publ->scope]->size++; 161 publ_lists[publ->scope]->size++;
162 162
163 if (publ->scope == TIPC_NODE_SCOPE)
164 return;
165
163 buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0); 166 buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
164 if (!buf) { 167 if (!buf) {
165 warn("Publication distribution failure\n"); 168 warn("Publication distribution failure\n");
@@ -183,6 +186,9 @@ void tipc_named_withdraw(struct publication *publ)
183 list_del(&publ->local_list); 186 list_del(&publ->local_list);
184 publ_lists[publ->scope]->size--; 187 publ_lists[publ->scope]->size--;
185 188
189 if (publ->scope == TIPC_NODE_SCOPE)
190 return;
191
186 buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0); 192 buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0);
187 if (!buf) { 193 if (!buf) {
188 warn("Withdrawal distribution failure\n"); 194 warn("Withdrawal distribution failure\n");
@@ -349,11 +355,11 @@ void tipc_named_recv(struct sk_buff *buf)
349} 355}
350 356
351/** 357/**
352 * tipc_named_reinit - re-initialize local publication list 358 * tipc_named_reinit - re-initialize local publications
353 * 359 *
354 * This routine is called whenever TIPC networking is enabled. 360 * This routine is called whenever TIPC networking is enabled.
355 * All existing publications by this node that have "cluster" or "zone" scope 361 * All name table entries published by this node are updated to reflect
356 * are updated to reflect the node's new network address. 362 * the node's new network address.
357 */ 363 */
358 364
359void tipc_named_reinit(void) 365void tipc_named_reinit(void)
@@ -363,7 +369,7 @@ void tipc_named_reinit(void)
363 369
364 write_lock_bh(&tipc_nametbl_lock); 370 write_lock_bh(&tipc_nametbl_lock);
365 371
366 for (scope = TIPC_ZONE_SCOPE; scope <= TIPC_CLUSTER_SCOPE; scope++) 372 for (scope = TIPC_ZONE_SCOPE; scope <= TIPC_NODE_SCOPE; scope++)
367 list_for_each_entry(publ, &publ_lists[scope]->list, local_list) 373 list_for_each_entry(publ, &publ_lists[scope]->list, local_list)
368 publ->node = tipc_own_addr; 374 publ->node = tipc_own_addr;
369 375
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);