diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/xfrm.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 4d6dc627df9b..11e0b1d6bd47 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -222,6 +222,7 @@ struct xfrm_policy_afinfo { | |||
222 | struct dst_ops *dst_ops; | 222 | struct dst_ops *dst_ops; |
223 | void (*garbage_collect)(void); | 223 | void (*garbage_collect)(void); |
224 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); | 224 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); |
225 | int (*get_saddr)(xfrm_address_t *saddr, xfrm_address_t *daddr); | ||
225 | struct dst_entry *(*find_bundle)(struct flowi *fl, struct xfrm_policy *policy); | 226 | struct dst_entry *(*find_bundle)(struct flowi *fl, struct xfrm_policy *policy); |
226 | int (*bundle_create)(struct xfrm_policy *policy, | 227 | int (*bundle_create)(struct xfrm_policy *policy, |
227 | struct xfrm_state **xfrm, | 228 | struct xfrm_state **xfrm, |
@@ -631,6 +632,18 @@ secpath_reset(struct sk_buff *skb) | |||
631 | } | 632 | } |
632 | 633 | ||
633 | static inline int | 634 | static inline int |
635 | xfrm_addr_any(xfrm_address_t *addr, unsigned short family) | ||
636 | { | ||
637 | switch (family) { | ||
638 | case AF_INET: | ||
639 | return addr->a4 == 0; | ||
640 | case AF_INET6: | ||
641 | return ipv6_addr_any((struct in6_addr *)&addr->a6); | ||
642 | } | ||
643 | return 0; | ||
644 | } | ||
645 | |||
646 | static inline int | ||
634 | __xfrm4_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x) | 647 | __xfrm4_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x) |
635 | { | 648 | { |
636 | return (tmpl->saddr.a4 && | 649 | return (tmpl->saddr.a4 && |