View | Details | Raw Unified | Return to bug 117749
Collapse All | Expand All

(-)build/net/xfrm/xfrm_policy.c (-4 / +30 lines)
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 (dst_orig && !dst_check(dst_orig, 0)) {
793
		printk(KERN_NOTICE "xfrm_lookup: IPv4 route is stale (obsolete=%u, loops=%d)\n",
794
				dst_orig->obsolete, loops);
795
		dump_stack();
796
		err = -EHOSTUNREACH;
797
		goto error;
798
	}
799
	if (unlikely(++loops > 10)) {
800
		printk(KERN_NOTICE "xfrm_lookup bailing out after %d loops\n", loops);
801
		err = -EHOSTUNREACH;
802
		goto error;
803
	}
804
790
	genid = atomic_read(&flow_cache_genid);
805
	genid = atomic_read(&flow_cache_genid);
791
	policy = NULL;
806
	policy = NULL;
792
	if (sk && sk->sk_policy[1])
807
	if (sk && sk->sk_policy[1])
Lines 854-859 restart: Link Here
854
				}
869
				}
855
				if (nx == -EAGAIN ||
870
				if (nx == -EAGAIN ||
856
				    genid != atomic_read(&flow_cache_genid)) {
871
				    genid != atomic_read(&flow_cache_genid)) {
872
					printk(KERN_NOTICE "xfrm_tmpl_resolve says EAGAIN, try again\n");
857
					xfrm_pol_put(policy);
873
					xfrm_pol_put(policy);
858
					goto restart;
874
					goto restart;
859
				}
875
				}
Lines 887-892 restart: Link Here
887
			 */
903
			 */
888
			write_unlock_bh(&policy->lock);
904
			write_unlock_bh(&policy->lock);
889
905
906
			printk(KERN_NOTICE "xfrm_lookup: newly created bundle is stale\n");
907
890
			xfrm_pol_put(policy);
908
			xfrm_pol_put(policy);
891
			if (dst)
909
			if (dst)
892
				dst_free(dst);
910
				dst_free(dst);
Lines 1196-1213 int xfrm_bundle_ok(struct xfrm_dst *firs Link Here
1196
	u32 mtu;
1214
	u32 mtu;
1197
1215
1198
	if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) ||
1216
	if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) ||
1199
	    (dst->dev && !netif_running(dst->dev)))
1217
	    (dst->dev && !netif_running(dst->dev))) {
1218
		printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__);
1200
		return 0;
1219
		return 0;
1220
	}
1201
1221
1202
	last = NULL;
1222
	last = NULL;
1203
1223
1204
	do {
1224
	do {
1205
		struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
1225
		struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
1206
1226
1207
		if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family))
1227
		if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family)) {
1228
			printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__);
1208
			return 0;
1229
			return 0;
1209
		if (dst->xfrm->km.state != XFRM_STATE_VALID)
1230
		}
1231
		if (dst->xfrm->km.state != XFRM_STATE_VALID) {
1232
			printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__);
1210
			return 0;
1233
			return 0;
1234
		}
1211
1235
1212
		mtu = dst_mtu(dst->child);
1236
		mtu = dst_mtu(dst->child);
1213
		if (xdst->child_mtu_cached != mtu) {
1237
		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;
1239
			xdst->child_mtu_cached = mtu;
1216
		}
1240
		}
1217
1241
1218
		if (!dst_check(xdst->route, xdst->route_cookie))
1242
		if (!dst_check(xdst->route, xdst->route_cookie)) {
1243
			printk(KERN_DEBUG "xfrm_bundle_ok: %u\n", __LINE__);
1219
			return 0;
1244
			return 0;
1245
		}
1220
		mtu = dst_mtu(xdst->route);
1246
		mtu = dst_mtu(xdst->route);
1221
		if (xdst->route_mtu_cached != mtu) {
1247
		if (xdst->route_mtu_cached != mtu) {
1222
			last = xdst;
1248
			last = xdst;

Return to bug 117749