aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-01 17:36:37 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-01 17:36:37 -0500
commit80c0bc9e37adfc892af82cb6aa8cace79f8a96cb (patch)
tree0f4abc233d9661e85c7c7ecb064a75a8f0984f1f
parenta1414715f0ac905fb4b3a158ff6548d37bbe6165 (diff)
xfrm: Kill XFRM_LOOKUP_WAIT flag.
This can be determined from the flow flags instead. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/dst.h3
-rw-r--r--net/decnet/dn_route.c5
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv6/ip6_output.c4
-rw-r--r--net/xfrm/xfrm_policy.c2
5 files changed, 8 insertions, 10 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 4fedffd7c56f..15d67c8d3ce8 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -421,8 +421,7 @@ extern void dst_init(void);
421 421
422/* Flags for xfrm_lookup flags argument. */ 422/* Flags for xfrm_lookup flags argument. */
423enum { 423enum {
424 XFRM_LOOKUP_WAIT = 1 << 0, 424 XFRM_LOOKUP_ICMP = 1 << 0,
425 XFRM_LOOKUP_ICMP = 1 << 1,
426}; 425};
427 426
428struct flowi; 427struct flowi;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 06c054d5ccba..0877147d2167 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1233,8 +1233,9 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock
1233 1233
1234 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD); 1234 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
1235 if (err == 0 && fl->proto) { 1235 if (err == 0 && fl->proto) {
1236 err = xfrm_lookup(&init_net, pprt, fl, sk, 1236 if (!(flags & MSG_DONTWAIT))
1237 (flags & MSG_DONTWAIT) ? 0 : XFRM_LOOKUP_WAIT); 1237 fl->flags |= FLOWI_FLAG_CAN_SLEEP;
1238 err = xfrm_lookup(&init_net, pprt, fl, sk, 0);
1238 } 1239 }
1239 return err; 1240 return err;
1240} 1241}
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 78462658fccb..23d205043d92 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2732,9 +2732,7 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
2732 flp->fl4_src = (*rp)->rt_src; 2732 flp->fl4_src = (*rp)->rt_src;
2733 if (!flp->fl4_dst) 2733 if (!flp->fl4_dst)
2734 flp->fl4_dst = (*rp)->rt_dst; 2734 flp->fl4_dst = (*rp)->rt_dst;
2735 err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk, 2735 err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk, 0);
2736 ((flp->flags & FLOWI_FLAG_CAN_SLEEP) ?
2737 XFRM_LOOKUP_WAIT : 0));
2738 if (err == -EREMOTE) 2736 if (err == -EREMOTE)
2739 err = ipv4_dst_blackhole(net, rp, flp); 2737 err = ipv4_dst_blackhole(net, rp, flp);
2740 2738
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index b5f8769dbdf4..faf7b9d1d536 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1027,7 +1027,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi *fl,
1027 ipv6_addr_copy(&fl->fl6_dst, final_dst); 1027 ipv6_addr_copy(&fl->fl6_dst, final_dst);
1028 if (can_sleep) { 1028 if (can_sleep) {
1029 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1029 fl->flags |= FLOWI_FLAG_CAN_SLEEP;
1030 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, XFRM_LOOKUP_WAIT); 1030 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0);
1031 if (err == -EREMOTE) 1031 if (err == -EREMOTE)
1032 err = ip6_dst_blackhole(sk, &dst, fl); 1032 err = ip6_dst_blackhole(sk, &dst, fl);
1033 if (err) 1033 if (err)
@@ -1072,7 +1072,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi *fl,
1072 ipv6_addr_copy(&fl->fl6_dst, final_dst); 1072 ipv6_addr_copy(&fl->fl6_dst, final_dst);
1073 if (can_sleep) { 1073 if (can_sleep) {
1074 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1074 fl->flags |= FLOWI_FLAG_CAN_SLEEP;
1075 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, XFRM_LOOKUP_WAIT); 1075 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0);
1076 if (err == -EREMOTE) 1076 if (err == -EREMOTE)
1077 err = ip6_dst_blackhole(sk, &dst, fl); 1077 err = ip6_dst_blackhole(sk, &dst, fl);
1078 if (err) 1078 if (err)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 41a91d27d3ea..f4c7467a614e 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1831,7 +1831,7 @@ restart:
1831 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES); 1831 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
1832 return -EREMOTE; 1832 return -EREMOTE;
1833 } 1833 }
1834 if (flags & XFRM_LOOKUP_WAIT) { 1834 if (fl->flags & FLOWI_FLAG_CAN_SLEEP) {
1835 DECLARE_WAITQUEUE(wait, current); 1835 DECLARE_WAITQUEUE(wait, current);
1836 1836
1837 add_wait_queue(&net->xfrm.km_waitq, &wait); 1837 add_wait_queue(&net->xfrm.km_waitq, &wait);