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

View file

@ -452,7 +452,7 @@ int selinux_xfrm_postroute_last(u32 sk_sid, struct sk_buff *skb,
if (dst) {
struct dst_entry *iter;
for (iter = dst; iter != NULL; iter = iter->child) {
for (iter = dst; iter != NULL; iter = xfrm_dst_child(iter)) {
struct xfrm_state *x = iter->xfrm;
if (x && selinux_authorizable_xfrm(x))