diff options
author | David Miller <davem@davemloft.net> | 2017-11-28 15:40:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-30 09:54:25 -0500 |
commit | b92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b (patch) | |
tree | f8fb92d4c9394bdf61716d074b9aaa15fbf22450 /include | |
parent | 071fb37ec43dcd88937a669c5f97bd37f7d29dea (diff) |
net: Create and use new helper xfrm_dst_child().
Only IPSEC routes have a non-NULL dst->child pointer. And IPSEC
routes are identified by a non-NULL dst->xfrm pointer.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/xfrm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index dc28a98ce97c..4021b49a6ce3 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -994,6 +994,15 @@ struct xfrm_dst { u32 path_cookie; }; +static inline struct dst_entry *xfrm_dst_child(const struct dst_entry *dst) +{ +#ifdef CONFIG_XFRM + if (dst->xfrm) + return dst->child; +#endif + return NULL; +} + #ifdef CONFIG_XFRM static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) { |