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>
This commit is contained in:
David Miller
2017-11-28 15:40:22 -05:00
committed by David S. Miller
parent 071fb37ec4
commit b92cf4aab8
8 changed files with 26 additions and 15 deletions

View File

@@ -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)
{