Commit bb72845e authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[IPSEC]: Make callers of xfrm_lookup to use XFRM_LOOKUP_WAIT

This patch converts all callers of xfrm_lookup that used an
explicit value of 1 to indiciate blocking to use the new flag
XFRM_LOOKUP_WAIT.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7233b9f3
...@@ -994,7 +994,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, ...@@ -994,7 +994,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
if (final_p) if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p); ipv6_addr_copy(&fl.fl6_dst, final_p);
err = __xfrm_lookup(&dst, &fl, sk, 1); err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT);
if (err < 0) { if (err < 0) {
if (err == -EREMOTE) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, &fl); err = ip6_dst_blackhole(sk, &dst, &fl);
......
...@@ -1196,7 +1196,8 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock ...@@ -1196,7 +1196,8 @@ 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(pprt, fl, sk, !(flags & MSG_DONTWAIT)); err = xfrm_lookup(pprt, fl, sk, (flags & MSG_DONTWAIT) ?
XFRM_LOOKUP_WAIT : 0);
} }
return err; return err;
} }
......
...@@ -2536,7 +2536,8 @@ int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, ...@@ -2536,7 +2536,8 @@ int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk,
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((struct dst_entry **)rp, flp, sk, flags); err = __xfrm_lookup((struct dst_entry **)rp, flp, sk,
flags ? XFRM_LOOKUP_WAIT : 0);
if (err == -EREMOTE) if (err == -EREMOTE)
err = ipv4_dst_blackhole(rp, flp, sk); err = ipv4_dst_blackhole(rp, flp, sk);
......
...@@ -177,7 +177,7 @@ ipv4_connected: ...@@ -177,7 +177,7 @@ ipv4_connected:
if (final_p) if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p); ipv6_addr_copy(&fl.fl6_dst, final_p);
if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) { if ((err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT)) < 0) {
if (err == -EREMOTE) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, &fl); err = ip6_dst_blackhole(sk, &dst, &fl);
if (err < 0) if (err < 0)
......
...@@ -871,7 +871,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -871,7 +871,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if (final_p) if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p); ipv6_addr_copy(&fl.fl6_dst, final_p);
if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) { if ((err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT)) < 0) {
if (err == -EREMOTE) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, &fl); err = ip6_dst_blackhole(sk, &dst, &fl);
if (err < 0) if (err < 0)
......
...@@ -265,7 +265,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, ...@@ -265,7 +265,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
if (final_p) if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p); ipv6_addr_copy(&fl.fl6_dst, final_p);
if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) { if ((err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT)) < 0) {
if (err == -EREMOTE) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, &fl); err = ip6_dst_blackhole(sk, &dst, &fl);
if (err < 0) if (err < 0)
......
...@@ -757,7 +757,7 @@ do_udp_sendmsg: ...@@ -757,7 +757,7 @@ do_udp_sendmsg:
if (final_p) if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p); ipv6_addr_copy(&fl.fl6_dst, final_p);
if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) { if ((err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT)) < 0) {
if (err == -EREMOTE) if (err == -EREMOTE)
err = ip6_dst_blackhole(sk, &dst, &fl); err = ip6_dst_blackhole(sk, &dst, &fl);
if (err < 0) if (err < 0)
......
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