summaryrefslogtreecommitdiffstats
path: root/net/tipc/name_table.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2012-04-18 00:02:01 +0200
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-04-19 21:46:39 +0200
commit336ebf5bf524e447227cb1d785b22ca722e6afa7 (patch)
tree72e72c183cf43ccfbb756a7866c8b3cf90eb6781 /net/tipc/name_table.c
parenttipc: Don't record failed publication attempt as a success (diff)
downloadlinux-336ebf5bf524e447227cb1d785b22ca722e6afa7.tar.xz
linux-336ebf5bf524e447227cb1d785b22ca722e6afa7.zip
tipc: Add routines for safe checking of node's network address
Introduces routines that test whether a given network address is equal to a node's own network address or if it lies within the node's own network cluster, and which work properly regardless of whether the node is using the default network address <0.0.0> or a non-zero network address that is assigned later on. In essence, these routines ensure that address <0.0.0> is treated as an alias for "this node", regardless of which network address the node is actually using. Old users of the pre-existing more strict match in_own_cluster() have been accordingly redirected to what is now called in_own_cluster_exact() --- which does not extend matching to <0,0,0>. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 5d7004262647..1e0518da19da 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -342,7 +342,7 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
list_add(&publ->zone_list, &info->zone_list);
info->zone_list_size++;
- if (in_own_cluster(node)) {
+ if (in_own_cluster_exact(node)) {
list_add(&publ->cluster_list, &info->cluster_list);
info->cluster_list_size++;
}
@@ -411,7 +411,7 @@ found:
/* Remove publication from cluster scope list, if present */
- if (in_own_cluster(node)) {
+ if (in_own_cluster_exact(node)) {
list_del(&publ->cluster_list);
info->cluster_list_size--;
}
@@ -604,7 +604,7 @@ u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode)
publ = list_first_entry(&info->node_list, struct publication,
node_list);
list_move_tail(&publ->node_list, &info->node_list);
- } else if (in_own_cluster(*destnode)) {
+ } else if (in_own_cluster_exact(*destnode)) {
if (list_empty(&info->cluster_list))
goto no_match;
publ = list_first_entry(&info->cluster_list, struct publication,