summaryrefslogtreecommitdiff
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2017-11-28 23:40:22 +0300
committerDavid S. Miller <davem@davemloft.net>2017-11-30 17:54:25 +0300
commitb92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b (patch)
treef8fb92d4c9394bdf61716d074b9aaa15fbf22450 /include/net/xfrm.h
parent071fb37ec43dcd88937a669c5f97bd37f7d29dea (diff)
downloadlinux-b92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b.tar.xz
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/net/xfrm.h')
-rw-r--r--include/net/xfrm.h9
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)
{