aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/addr.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-03-22 20:42:49 +0100
committerDavid S. Miller <davem@davemloft.net>2018-03-23 13:12:18 -0400
commit23fd3eace088ab1872ee59c19191a119ec779ac9 (patch)
tree9469f540f7bd0279b0359bff04362877bd28e27b /net/tipc/addr.c
parenttipc: allow closest-first lookup algorithm when legacy address is configured (diff)
downloadlinux-dev-23fd3eace088ab1872ee59c19191a119ec779ac9.tar.xz
linux-dev-23fd3eace088ab1872ee59c19191a119ec779ac9.zip
tipc: remove direct accesses to own_addr field in struct tipc_net
As a preparation to changing the addressing structure of TIPC we replace all direct accesses to the tipc_net::own_addr field with the function dedicated for this, tipc_own_addr(). There are no changes to program logics in this commit. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/addr.c')
-rw-r--r--net/tipc/addr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/tipc/addr.c b/net/tipc/addr.c
index 19987994704f..6e06b4d981f1 100644
--- a/net/tipc/addr.c
+++ b/net/tipc/addr.c
@@ -43,9 +43,7 @@
*/
int in_own_node(struct net *net, u32 addr)
{
- struct tipc_net *tn = net_generic(net, tipc_net_id);
-
- return (addr == tn->own_addr) || !addr;
+ return addr == tipc_own_addr(net) || !addr;
}
bool tipc_in_scope(bool legacy_format, u32 domain, u32 addr)
@@ -56,6 +54,8 @@ bool tipc_in_scope(bool legacy_format, u32 domain, u32 addr)
return false;
if (domain == tipc_cluster_mask(addr)) /* domain <Z.C.0> */
return true;
+ if (domain == (addr & TIPC_ZONE_CLUSTER_MASK)) /* domain <Z.C.0> */
+ return true;
if (domain == (addr & TIPC_ZONE_MASK)) /* domain <Z.0.0> */
return true;
return false;