tipc: Add network address mask helper routines

Introduces a pair of helper routines that convert the network address
for a TIPC node into the network address for its cluster or zone.

This is a cosmetic change designed to avoid future errors caused by
the incorrect use of address bitmasks, and does not alter the existing
operation of TIPC.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This commit is contained in:
Allan Stephens
2011-02-23 11:44:49 -05:00
committed by Paul Gortmaker
parent aa84729484
commit a3796f895f
3 changed files with 16 additions and 7 deletions

View File

@ -81,9 +81,9 @@ int tipc_in_scope(u32 domain, u32 addr)
{
if (!domain || (domain == addr))
return 1;
if (domain == (addr & 0xfffff000u)) /* domain <Z.C.0> */
if (domain == tipc_cluster_mask(addr)) /* domain <Z.C.0> */
return 1;
if (domain == (addr & 0xff000000u)) /* domain <Z.0.0> */
if (domain == tipc_zone_mask(addr)) /* domain <Z.0.0> */
return 1;
return 0;
}