Skip to content

Commit

Permalink
tipc: Eliminate useless check when network address is assigned
Browse files Browse the repository at this point in the history
Gets rid of an unnecessary check in the routine that updates the port id
of a node's name publications when the node is assigned a network address,
since the routine is only invoked if the new address is different from
the existing one.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Dec 27, 2011
1 parent 97f1b62 commit 945af1c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions net/tipc/name_distr.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,21 +322,19 @@ void tipc_named_recv(struct sk_buff *buf)
/**
* tipc_named_reinit - re-initialize local publication list
*
* This routine is called whenever TIPC networking is (re)enabled.
* 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 current network address.
* (If the node's address is unchanged, the update loop terminates immediately.)
* are updated to reflect the node's new network address.
*/

void tipc_named_reinit(void)
{
struct publication *publ;

write_lock_bh(&tipc_nametbl_lock);
list_for_each_entry(publ, &publ_root, local_list) {
if (publ->node == tipc_own_addr)
break;

list_for_each_entry(publ, &publ_root, local_list)
publ->node = tipc_own_addr;
}

write_unlock_bh(&tipc_nametbl_lock);
}

0 comments on commit 945af1c

Please sign in to comment.