From 336ebf5bf524e447227cb1d785b22ca722e6afa7 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Tue, 17 Apr 2012 18:02:01 -0400 Subject: 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 Signed-off-by: Paul Gortmaker --- net/tipc/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/tipc/node.c') diff --git a/net/tipc/node.c b/net/tipc/node.c index a34cabc2c43a..6a71bea91db0 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -72,7 +72,7 @@ struct tipc_node *tipc_node_find(u32 addr) struct tipc_node *node; struct hlist_node *pos; - if (unlikely(!in_own_cluster(addr))) + if (unlikely(!in_own_cluster_exact(addr))) return NULL; hlist_for_each_entry(node, pos, &node_htable[tipc_hashfn(addr)], hash) { -- cgit v1.2.3