diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/xfrm.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 0d8a797f0441..de34883e8b16 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1574,27 +1574,26 @@ extern struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe); | |||
1574 | extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, | 1574 | extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, |
1575 | int probe); | 1575 | int probe); |
1576 | 1576 | ||
1577 | static inline int xfrm_addr_cmp(const xfrm_address_t *a, | 1577 | static inline bool xfrm6_addr_equal(const xfrm_address_t *a, |
1578 | const xfrm_address_t *b, | 1578 | const xfrm_address_t *b) |
1579 | int family) | 1579 | { |
1580 | return ipv6_addr_equal((const struct in6_addr *)a, | ||
1581 | (const struct in6_addr *)b); | ||
1582 | } | ||
1583 | |||
1584 | static inline bool xfrm_addr_equal(const xfrm_address_t *a, | ||
1585 | const xfrm_address_t *b, | ||
1586 | sa_family_t family) | ||
1580 | { | 1587 | { |
1581 | switch (family) { | 1588 | switch (family) { |
1582 | default: | 1589 | default: |
1583 | case AF_INET: | 1590 | case AF_INET: |
1584 | return (__force u32)a->a4 - (__force u32)b->a4; | 1591 | return ((__force u32)a->a4 ^ (__force u32)b->a4) == 0; |
1585 | case AF_INET6: | 1592 | case AF_INET6: |
1586 | return ipv6_addr_cmp((const struct in6_addr *)a, | 1593 | return xfrm6_addr_equal(a, b); |
1587 | (const struct in6_addr *)b); | ||
1588 | } | 1594 | } |
1589 | } | 1595 | } |
1590 | 1596 | ||
1591 | static inline bool xfrm6_addr_equal(const xfrm_address_t *a, | ||
1592 | const xfrm_address_t *b) | ||
1593 | { | ||
1594 | return ipv6_addr_equal((const struct in6_addr *)a, | ||
1595 | (const struct in6_addr *)b); | ||
1596 | } | ||
1597 | |||
1598 | static inline int xfrm_policy_id2dir(u32 index) | 1597 | static inline int xfrm_policy_id2dir(u32 index) |
1599 | { | 1598 | { |
1600 | return index & 7; | 1599 | return index & 7; |