summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid Miller2017-11-28 21:40:22 +0100
committerDavid S. Miller2017-11-30 15:54:25 +0100
commitb92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b (patch)
treef8fb92d4c9394bdf61716d074b9aaa15fbf22450 /net/core
parentipv6: Move rt6_next from dst_entry into ipv6 route structure. (diff)
downloadkernel-qcow2-linux-b92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b.tar.gz
kernel-qcow2-linux-b92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b.tar.xz
kernel-qcow2-linux-b92cf4aab8e688b1bd501ac2ac4f1b5c99601e3b.zip
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 'net/core')
-rw-r--r--net/core/dst.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/dst.c b/net/core/dst.c
index 662a2d4a3d19..6a3c21b8fc8d 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -116,12 +116,14 @@ EXPORT_SYMBOL(dst_alloc);
struct dst_entry *dst_destroy(struct dst_entry * dst)
{
- struct dst_entry *child;
+ struct dst_entry *child = NULL;
smp_rmb();
- child = dst->child;
-
+#ifdef CONFIG_XFRM
+ if (dst->xfrm)
+ child = dst->child;
+#endif
if (!(dst->flags & DST_NOCOUNT))
dst_entries_add(dst->ops, -1);