xfrm: Kill XFRM_LOOKUP_WAIT flag.
authorDavid S. Miller <davem@davemloft.net>
Tue, 1 Mar 2011 22:36:37 +0000 (14:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Mar 2011 22:36:37 +0000 (14:36 -0800)
This can be determined from the flow flags instead.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dst.h
net/decnet/dn_route.c
net/ipv4/route.c
net/ipv6/ip6_output.c
net/xfrm/xfrm_policy.c

index 4fedffd7c56f17f6a114e67ef329835155fec1f0..15d67c8d3ce8f08e3268a8cbb2b574966aac2a84 100644 (file)
@@ -421,8 +421,7 @@ extern void         dst_init(void);
 
 /* Flags for xfrm_lookup flags argument. */
 enum {
-       XFRM_LOOKUP_WAIT = 1 << 0,
-       XFRM_LOOKUP_ICMP = 1 << 1,
+       XFRM_LOOKUP_ICMP = 1 << 0,
 };
 
 struct flowi;
index 06c054d5ccba4917c66dd19e56f26dc0d1d66314..0877147d2167f62e19fdc2378492bc6cc92b5d55 100644 (file)
@@ -1233,8 +1233,9 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock
 
        err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
        if (err == 0 && fl->proto) {
-               err = xfrm_lookup(&init_net, pprt, fl, sk,
-                                (flags & MSG_DONTWAIT) ? 0 : XFRM_LOOKUP_WAIT);
+               if (!(flags & MSG_DONTWAIT))
+                       fl->flags |= FLOWI_FLAG_CAN_SLEEP;
+               err = xfrm_lookup(&init_net, pprt, fl, sk, 0);
        }
        return err;
 }
index 78462658fccb11d9494d2f2a00e110afe68aac08..23d205043d92e6832870e67e1505c92e1bccf821 100644 (file)
@@ -2732,9 +2732,7 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
                        flp->fl4_src = (*rp)->rt_src;
                if (!flp->fl4_dst)
                        flp->fl4_dst = (*rp)->rt_dst;
-               err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk,
-                                   ((flp->flags & FLOWI_FLAG_CAN_SLEEP) ?
-                                    XFRM_LOOKUP_WAIT : 0));
+               err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk, 0);
                if (err == -EREMOTE)
                        err = ipv4_dst_blackhole(net, rp, flp);
 
index b5f8769dbdf42fcb4e0d26777e316d25112f9754..faf7b9d1d536258cb4ba44a3d899c1c2fe6b51b3 100644 (file)
@@ -1027,7 +1027,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi *fl,
                ipv6_addr_copy(&fl->fl6_dst, final_dst);
        if (can_sleep) {
                fl->flags |= FLOWI_FLAG_CAN_SLEEP;
-               err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, XFRM_LOOKUP_WAIT);
+               err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0);
                if (err == -EREMOTE)
                        err = ip6_dst_blackhole(sk, &dst, fl);
                if (err)
@@ -1072,7 +1072,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi *fl,
                ipv6_addr_copy(&fl->fl6_dst, final_dst);
        if (can_sleep) {
                fl->flags |= FLOWI_FLAG_CAN_SLEEP;
-               err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, XFRM_LOOKUP_WAIT);
+               err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0);
                if (err == -EREMOTE)
                        err = ip6_dst_blackhole(sk, &dst, fl);
                if (err)
index 41a91d27d3ea819e909502af1f69b88c695dc8a8..f4c7467a614e9ca51b7c868fc42c84314020d7b3 100644 (file)
@@ -1831,7 +1831,7 @@ restart:
                        XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
                        return -EREMOTE;
                }
-               if (flags & XFRM_LOOKUP_WAIT) {
+               if (fl->flags & FLOWI_FLAG_CAN_SLEEP) {
                        DECLARE_WAITQUEUE(wait, current);
 
                        add_wait_queue(&net->xfrm.km_waitq, &wait);