X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=net%2Ftipc%2Faddr.c;h=a6fdab33877e2051c23a0d2a33a5549178e04bc1;hb=390bce4237487975c2168aa5fa786f75ead66852;hp=88463d9a6f12c99562378a5c8c93b39329b19cf3;hpb=5b2eef966cb2ae307aa4ef1767f7307774bc96ca;p=cascardo%2Flinux.git diff --git a/net/tipc/addr.c b/net/tipc/addr.c index 88463d9a6f12..a6fdab33877e 100644 --- a/net/tipc/addr.c +++ b/net/tipc/addr.c @@ -2,7 +2,7 @@ * net/tipc/addr.c: TIPC address utility routines * * Copyright (c) 2000-2006, Ericsson AB - * Copyright (c) 2004-2005, Wind River Systems + * Copyright (c) 2004-2005, 2010-2011, Wind River Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ * tipc_addr_domain_valid - validates a network domain address * * Accepts , , , and <0.0.0>, - * where Z, C, and N are non-zero and do not exceed the configured limits. + * where Z, C, and N are non-zero. * * Returns 1 if domain address is valid, otherwise 0 */ @@ -51,10 +51,6 @@ int tipc_addr_domain_valid(u32 addr) u32 n = tipc_node(addr); u32 c = tipc_cluster(addr); u32 z = tipc_zone(addr); - u32 max_nodes = tipc_max_nodes; - - if (n > max_nodes) - return 0; if (n && (!z || !c)) return 0; @@ -66,8 +62,7 @@ int tipc_addr_domain_valid(u32 addr) /** * tipc_addr_node_valid - validates a proposed network address for this node * - * Accepts , where Z, C, and N are non-zero and do not exceed - * the configured limits. + * Accepts , where Z, C, and N are non-zero. * * Returns 1 if address can be used, otherwise 0 */ @@ -81,9 +76,9 @@ int tipc_in_scope(u32 domain, u32 addr) { if (!domain || (domain == addr)) return 1; - if (domain == (addr & 0xfffff000u)) /* domain */ + if (domain == tipc_cluster_mask(addr)) /* domain */ return 1; - if (domain == (addr & 0xff000000u)) /* domain */ + if (domain == tipc_zone_mask(addr)) /* domain */ return 1; return 0; }