diff options
-rw-r--r-- | include/net/xfrm.h | 2 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 4 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e142a256d5dc..d675836ba6c3 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -515,6 +515,8 @@ struct xfrm_dst | |||
515 | struct dst_entry *route; | 515 | struct dst_entry *route; |
516 | u32 route_mtu_cached; | 516 | u32 route_mtu_cached; |
517 | u32 child_mtu_cached; | 517 | u32 child_mtu_cached; |
518 | u32 route_cookie; | ||
519 | u32 path_cookie; | ||
518 | }; | 520 | }; |
519 | 521 | ||
520 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | 522 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 4429b1a1fe5f..cf1d91e74c82 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -113,6 +113,8 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int | |||
113 | 113 | ||
114 | xdst = (struct xfrm_dst *)dst1; | 114 | xdst = (struct xfrm_dst *)dst1; |
115 | xdst->route = &rt->u.dst; | 115 | xdst->route = &rt->u.dst; |
116 | if (rt->rt6i_node) | ||
117 | xdst->route_cookie = rt->rt6i_node->fn_sernum; | ||
116 | 118 | ||
117 | dst1->next = dst_prev; | 119 | dst1->next = dst_prev; |
118 | dst_prev = dst1; | 120 | dst_prev = dst1; |
@@ -137,6 +139,8 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int | |||
137 | 139 | ||
138 | dst_prev->child = &rt->u.dst; | 140 | dst_prev->child = &rt->u.dst; |
139 | dst->path = &rt->u.dst; | 141 | dst->path = &rt->u.dst; |
142 | if (rt->rt6i_node) | ||
143 | ((struct xfrm_dst *)dst)->path_cookie = rt->rt6i_node->fn_sernum; | ||
140 | 144 | ||
141 | *dst_p = dst; | 145 | *dst_p = dst; |
142 | dst = dst_prev; | 146 | dst = dst_prev; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 55ed979db144..d07f5ce31824 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1136,7 +1136,7 @@ int xfrm_bundle_ok(struct xfrm_dst *first, struct flowi *fl, int family) | |||
1136 | struct xfrm_dst *last; | 1136 | struct xfrm_dst *last; |
1137 | u32 mtu; | 1137 | u32 mtu; |
1138 | 1138 | ||
1139 | if (!dst_check(dst->path, 0) || | 1139 | if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) || |
1140 | (dst->dev && !netif_running(dst->dev))) | 1140 | (dst->dev && !netif_running(dst->dev))) |
1141 | return 0; | 1141 | return 0; |
1142 | 1142 | ||
@@ -1156,7 +1156,7 @@ int xfrm_bundle_ok(struct xfrm_dst *first, struct flowi *fl, int family) | |||
1156 | xdst->child_mtu_cached = mtu; | 1156 | xdst->child_mtu_cached = mtu; |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | if (!dst_check(xdst->route, 0)) | 1159 | if (!dst_check(xdst->route, xdst->route_cookie)) |
1160 | return 0; | 1160 | return 0; |
1161 | mtu = dst_mtu(xdst->route); | 1161 | mtu = dst_mtu(xdst->route); |
1162 | if (xdst->route_mtu_cached != mtu) { | 1162 | if (xdst->route_mtu_cached != mtu) { |