|
Lines 742-748
int xfrm_lookup(struct dst_entry **dst_p
Link Here
|
| 742 |
int err; |
742 |
int err; |
| 743 |
u32 genid; |
743 |
u32 genid; |
| 744 |
u16 family = dst_orig->ops->family; |
744 |
u16 family = dst_orig->ops->family; |
|
|
745 |
int loops = 0; |
| 746 |
|
| 745 |
restart: |
747 |
restart: |
|
|
748 |
if (unlikely(++loops > 10)) { |
| 749 |
err = -EHOSTUNREACH; |
| 750 |
goto error; |
| 751 |
} |
| 752 |
|
| 746 |
genid = atomic_read(&flow_cache_genid); |
753 |
genid = atomic_read(&flow_cache_genid); |
| 747 |
policy = NULL; |
754 |
policy = NULL; |
| 748 |
if (sk && sk->sk_policy[1]) |
755 |
if (sk && sk->sk_policy[1]) |
|
Lines 844-849
restart:
Link Here
|
| 844 |
*/ |
851 |
*/ |
| 845 |
write_unlock_bh(&policy->lock); |
852 |
write_unlock_bh(&policy->lock); |
| 846 |
|
853 |
|
|
|
854 |
printk(KERN_NOTICE "xfrm_lookup: newly created bundle is stale\n"); |
| 855 |
|
| 847 |
xfrm_pol_put(policy); |
856 |
xfrm_pol_put(policy); |
| 848 |
if (dst) |
857 |
if (dst) |
| 849 |
dst_free(dst); |
858 |
dst_free(dst); |
|
Lines 1140-1157
int xfrm_bundle_ok(struct xfrm_dst *firs
Link Here
|
| 1140 |
u32 mtu; |
1149 |
u32 mtu; |
| 1141 |
|
1150 |
|
| 1142 |
if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) || |
1151 |
if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) || |
| 1143 |
(dst->dev && !netif_running(dst->dev))) |
1152 |
(dst->dev && !netif_running(dst->dev))) { |
|
|
1153 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1144 |
return 0; |
1154 |
return 0; |
|
|
1155 |
} |
| 1145 |
|
1156 |
|
| 1146 |
last = NULL; |
1157 |
last = NULL; |
| 1147 |
|
1158 |
|
| 1148 |
do { |
1159 |
do { |
| 1149 |
struct xfrm_dst *xdst = (struct xfrm_dst *)dst; |
1160 |
struct xfrm_dst *xdst = (struct xfrm_dst *)dst; |
| 1150 |
|
1161 |
|
| 1151 |
if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family)) |
1162 |
if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family)) { |
|
|
1163 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1152 |
return 0; |
1164 |
return 0; |
| 1153 |
if (dst->xfrm->km.state != XFRM_STATE_VALID) |
1165 |
} |
|
|
1166 |
if (dst->xfrm->km.state != XFRM_STATE_VALID) { |
| 1167 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1154 |
return 0; |
1168 |
return 0; |
|
|
1169 |
} |
| 1155 |
|
1170 |
|
| 1156 |
mtu = dst_mtu(dst->child); |
1171 |
mtu = dst_mtu(dst->child); |
| 1157 |
if (xdst->child_mtu_cached != mtu) { |
1172 |
if (xdst->child_mtu_cached != mtu) { |
|
Lines 1159-1166
int xfrm_bundle_ok(struct xfrm_dst *firs
Link Here
|
| 1159 |
xdst->child_mtu_cached = mtu; |
1174 |
xdst->child_mtu_cached = mtu; |
| 1160 |
} |
1175 |
} |
| 1161 |
|
1176 |
|
| 1162 |
if (!dst_check(xdst->route, xdst->route_cookie)) |
1177 |
if (!dst_check(xdst->route, xdst->route_cookie)) { |
|
|
1178 |
printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__); |
| 1163 |
return 0; |
1179 |
return 0; |
|
|
1180 |
} |
| 1164 |
mtu = dst_mtu(xdst->route); |
1181 |
mtu = dst_mtu(xdst->route); |
| 1165 |
if (xdst->route_mtu_cached != mtu) { |
1182 |
if (xdst->route_mtu_cached != mtu) { |
| 1166 |
last = xdst; |
1183 |
last = xdst; |