aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-02-22 21:02:12 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-22 21:02:12 -0500
commit1744a8fe09e5db7315a57da52fa7c1afa779cfa0 (patch)
tree702f2f6442f60580c61226c93dd74c70ed00d8f8 /include/net/xfrm.h
parent8f029de281b26ec9fd5cd77294db1d35d9876f1a (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>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h13
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)
765 atomic_inc(&x->refcnt); 765 atomic_inc(&x->refcnt);
766} 766}
767 767
768static __inline__ int addr_match(void *token1, void *token2, int prefixlen) 768static inline bool addr_match(const void *token1, const void *token2,
769 int prefixlen)
769{ 770{
770 __be32 *a1 = token1; 771 const __be32 *a1 = token1;
771 __be32 *a2 = token2; 772 const __be32 *a2 = token2;
772 int pdw; 773 int pdw;
773 int pbi; 774 int pbi;
774 775
@@ -777,7 +778,7 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen)
777 778
778 if (pdw) 779 if (pdw)
779 if (memcmp(a1, a2, pdw << 2)) 780 if (memcmp(a1, a2, pdw << 2))
780 return 0; 781 return false;
781 782
782 if (pbi) { 783 if (pbi) {
783 __be32 mask; 784 __be32 mask;
@@ -785,10 +786,10 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen)
785 mask = htonl((0xffffffff) << (32 - pbi)); 786 mask = htonl((0xffffffff) << (32 - pbi));
786 787
787 if ((a1[pdw] ^ a2[pdw]) & mask) 788 if ((a1[pdw] ^ a2[pdw]) & mask)
788 return 0; 789 return false;
789 } 790 }
790 791
791 return 1; 792 return true;
792} 793}
793 794
794static __inline__ 795static __inline__