Commit 80c0bc9e authored by David S. Miller's avatar David S. Miller

xfrm: Kill XFRM_LOOKUP_WAIT flag.

This can be determined from the flow flags instead.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a1414715
...@@ -421,8 +421,7 @@ extern void dst_init(void); ...@@ -421,8 +421,7 @@ extern void dst_init(void);
/* Flags for xfrm_lookup flags argument. */ /* Flags for xfrm_lookup flags argument. */
enum { enum {
XFRM_LOOKUP_WAIT = 1 << 0, XFRM_LOOKUP_ICMP = 1 << 0,
XFRM_LOOKUP_ICMP = 1 << 1,
}; };
struct flowi; struct flowi;
......
...@@ -1233,8 +1233,9 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock ...@@ -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); err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
if (err == 0 && fl->proto) { if (err == 0 && fl->proto) {
err = xfrm_lookup(&init_net, pprt, fl, sk, if (!(flags & MSG_DONTWAIT))
(flags & MSG_DONTWAIT) ? 0 : XFRM_LOOKUP_WAIT); fl->flags |= FLOWI_FLAG_CAN_SLEEP;
err = xfrm_lookup(&init_net, pprt, fl, sk, 0);
} }
return err; return err;
} }
......
...@@ -2732,9 +2732,7 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp, ...@@ -2732,9 +2732,7 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
flp->fl4_src = (*rp)->rt_src; flp->fl4_src = (*rp)->rt_src;
if (!flp->fl4_dst) if (!flp->fl4_dst)
flp->fl4_dst = (*rp)->rt_dst; flp->fl4_dst = (*rp)->rt_dst;
err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk, err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk, 0);
((flp->flags & FLOWI_FLAG_CAN_SLEEP) ?
XFRM_LOOKUP_WAIT : 0));
if (err == -EREMOTE) if (err == -EREMOTE)
err = ipv4_dst_blackhole(net, rp, flp); err = ipv4_dst_blackhole(net, rp, flp);
......
...@@ -1027,7 +1027,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi *fl, ...@@ -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); ipv6_addr_copy(&fl->fl6_dst, final_dst);
if (can_sleep) { if (can_sleep) {
fl->flags |= FLOWI_FLAG_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) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, fl); err = ip6_dst_blackhole(sk, &dst, fl);
if (err) if (err)
...@@ -1072,7 +1072,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi *fl, ...@@ -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); ipv6_addr_copy(&fl->fl6_dst, final_dst);
if (can_sleep) { if (can_sleep) {
fl->flags |= FLOWI_FLAG_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) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, fl); err = ip6_dst_blackhole(sk, &dst, fl);
if (err) if (err)
......
...@@ -1831,7 +1831,7 @@ int __xfrm_lookup(struct net *net, struct dst_entry **dst_p, ...@@ -1831,7 +1831,7 @@ int __xfrm_lookup(struct net *net, struct dst_entry **dst_p,
XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES); XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
return -EREMOTE; return -EREMOTE;
} }
if (flags & XFRM_LOOKUP_WAIT) { if (fl->flags & FLOWI_FLAG_CAN_SLEEP) {
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
add_wait_queue(&net->xfrm.km_waitq, &wait); add_wait_queue(&net->xfrm.km_waitq, &wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment