|
Lines 786-792
int xfrm_lookup(struct dst_entry **dst_p
Link Here
|
| 786 |
u16 family = dst_orig->ops->family; |
786 |
u16 family = dst_orig->ops->family; |
| 787 |
u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); |
787 |
u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); |
| 788 |
u32 sk_sid = security_sk_sid(sk, fl, dir); |
788 |
u32 sk_sid = security_sk_sid(sk, fl, dir); |
|
|
789 |
int loops = 0; |
| 790 |
|
| 789 |
restart: |
791 |
restart: |
|
|
792 |
if (unlikely(++loops > 10)) { |
| 793 |
printk(KERN_NOTICE "xfrm_lookup bailing out after %d loops\n", loops); |
| 794 |
err = -EHOSTUNREACH; |
| 795 |
goto error; |
| 796 |
} |
| 797 |
|
| 790 |
genid = atomic_read(&flow_cache_genid); |
798 |
genid = atomic_read(&flow_cache_genid); |
| 791 |
policy = NULL; |
799 |
policy = NULL; |
| 792 |
if (sk && sk->sk_policy[1]) |
800 |
if (sk && sk->sk_policy[1]) |
|
Lines 887-892
restart:
Link Here
|
| 887 |
*/ |
895 |
*/ |
| 888 |
write_unlock_bh(&policy->lock); |
896 |
write_unlock_bh(&policy->lock); |
| 889 |
|
897 |
|
|
|
898 |
printk(KERN_NOTICE "xfrm_lookup: newly created bundle is stale\n"); |
| 899 |
|
| 890 |
xfrm_pol_put(policy); |
900 |
xfrm_pol_put(policy); |
| 891 |
if (dst) |
901 |
if (dst) |
| 892 |
dst_free(dst); |
902 |
dst_free(dst); |
|
Lines 1196-1213
int xfrm_bundle_ok(struct xfrm_dst *firs
Link Here
|
| 1196 |
u32 mtu; |
1206 |
u32 mtu; |
| 1197 |
|
1207 |
|
| 1198 |
if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) || |
1208 |
if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) || |
| 1199 |
(dst->dev && !netif_running(dst->dev))) |
1209 |
(dst->dev && !netif_running(dst->dev))) { |
|
|
1210 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1200 |
return 0; |
1211 |
return 0; |
|
|
1212 |
} |
| 1201 |
|
1213 |
|
| 1202 |
last = NULL; |
1214 |
last = NULL; |
| 1203 |
|
1215 |
|
| 1204 |
do { |
1216 |
do { |
| 1205 |
struct xfrm_dst *xdst = (struct xfrm_dst *)dst; |
1217 |
struct xfrm_dst *xdst = (struct xfrm_dst *)dst; |
| 1206 |
|
1218 |
|
| 1207 |
if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family)) |
1219 |
if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family)) { |
|
|
1220 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1208 |
return 0; |
1221 |
return 0; |
| 1209 |
if (dst->xfrm->km.state != XFRM_STATE_VALID) |
1222 |
} |
|
|
1223 |
if (dst->xfrm->km.state != XFRM_STATE_VALID) { |
| 1224 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1210 |
return 0; |
1225 |
return 0; |
|
|
1226 |
} |
| 1211 |
|
1227 |
|
| 1212 |
mtu = dst_mtu(dst->child); |
1228 |
mtu = dst_mtu(dst->child); |
| 1213 |
if (xdst->child_mtu_cached != mtu) { |
1229 |
if (xdst->child_mtu_cached != mtu) { |
|
Lines 1215-1222
int xfrm_bundle_ok(struct xfrm_dst *firs
Link Here
|
| 1215 |
xdst->child_mtu_cached = mtu; |
1231 |
xdst->child_mtu_cached = mtu; |
| 1216 |
} |
1232 |
} |
| 1217 |
|
1233 |
|
| 1218 |
if (!dst_check(xdst->route, xdst->route_cookie)) |
1234 |
if (!dst_check(xdst->route, xdst->route_cookie)) { |
|
|
1235 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1219 |
return 0; |
1236 |
return 0; |
|
|
1237 |
} |
| 1220 |
mtu = dst_mtu(xdst->route); |
1238 |
mtu = dst_mtu(xdst->route); |
| 1221 |
if (xdst->route_mtu_cached != mtu) { |
1239 |
if (xdst->route_mtu_cached != mtu) { |
| 1222 |
last = xdst; |
1240 |
last = xdst; |