diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-22 18:02:12 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-22 18:02:12 -0800 |
commit | 1744a8fe09e5db7315a57da52fa7c1afa779cfa0 (patch) | |
tree | 702f2f6442f60580c61226c93dd74c70ed00d8f8 | |
parent | 8f029de281b26ec9fd5cd77294db1d35d9876f1a (diff) |
xfrm: Mark token args to addr_match() const.
Also, make it return a real bool.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/xfrm.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index cbe00035416d..2328532f0076 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -765,10 +765,11 @@ static inline void xfrm_state_hold(struct xfrm_state *x) atomic_inc(&x->refcnt); } -static __inline__ int addr_match(void *token1, void *token2, int prefixlen) +static inline bool addr_match(const void *token1, const void *token2, + int prefixlen) { - __be32 *a1 = token1; - __be32 *a2 = token2; + const __be32 *a1 = token1; + const __be32 *a2 = token2; int pdw; int pbi; @@ -777,7 +778,7 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen) if (pdw) if (memcmp(a1, a2, pdw << 2)) - return 0; + return false; if (pbi) { __be32 mask; @@ -785,10 +786,10 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen) mask = htonl((0xffffffff) << (32 - pbi)); if ((a1[pdw] ^ a2[pdw]) & mask) - return 0; + return false; } - return 1; + return true; } static __inline__ |