aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 05:09:21 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 15:38:45 -0500
commit8eb9086f21c73b38b5ca27558db4c91d62d0e70b (patch)
tree1fa2694f1e5eac966cc8db2fb8d5f3d684b09803 /net
parentba7808eac17360dda459f82222859b0e3879854b (diff)
[IPV4/IPV6]: Always wait for IPSEC SA resolution in socket contexts.
Do this even for non-blocking sockets. This avoids the silly -EAGAIN that applications can see now, even for non-blocking sockets in some cases (f.e. connect()). With help from Venkat Tekkirala. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/ipv4.c2
-rw-r--r--net/dccp/ipv6.c2
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/datagram.c2
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv4/udp.c2
-rw-r--r--net/ipv6/datagram.c2
-rw-r--r--net/ipv6/raw.c2
-rw-r--r--net/ipv6/tcp_ipv6.c2
-rw-r--r--net/ipv6/udp.c2
11 files changed, 11 insertions, 11 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 90c74b4adb73..fa2c982d4309 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -72,7 +72,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
72 tmp = ip_route_connect(&rt, nexthop, inet->saddr, 72 tmp = ip_route_connect(&rt, nexthop, inet->saddr,
73 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, 73 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
74 IPPROTO_DCCP, 74 IPPROTO_DCCP,
75 inet->sport, usin->sin_port, sk); 75 inet->sport, usin->sin_port, sk, 1);
76 if (tmp < 0) 76 if (tmp < 0)
77 return tmp; 77 return tmp;
78 78
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 6b91a9dd0411..79140b3e592e 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1041,7 +1041,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
1041 if (final_p) 1041 if (final_p)
1042 ipv6_addr_copy(&fl.fl6_dst, final_p); 1042 ipv6_addr_copy(&fl.fl6_dst, final_p);
1043 1043
1044 err = xfrm_lookup(&dst, &fl, sk, 0); 1044 err = xfrm_lookup(&dst, &fl, sk, 1);
1045 if (err < 0) 1045 if (err < 0)
1046 goto failure; 1046 goto failure;
1047 1047
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 864009643675..5750a2b2a0d6 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1007,7 +1007,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)
1007 RT_CONN_FLAGS(sk), 1007 RT_CONN_FLAGS(sk),
1008 sk->sk_bound_dev_if, 1008 sk->sk_bound_dev_if,
1009 sk->sk_protocol, 1009 sk->sk_protocol,
1010 inet->sport, inet->dport, sk); 1010 inet->sport, inet->dport, sk, 0);
1011 if (err) 1011 if (err)
1012 return err; 1012 return err;
1013 1013
diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c
index 7b068a891953..0072d79f0c2a 100644
--- a/net/ipv4/datagram.c
+++ b/net/ipv4/datagram.c
@@ -49,7 +49,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
49 err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr, 49 err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr,
50 RT_CONN_FLAGS(sk), oif, 50 RT_CONN_FLAGS(sk), oif,
51 sk->sk_protocol, 51 sk->sk_protocol,
52 inet->sport, usin->sin_port, sk); 52 inet->sport, usin->sin_port, sk, 1);
53 if (err) 53 if (err)
54 return err; 54 return err;
55 if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) { 55 if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index a6c63bbd9ddb..fed6a1e7af9e 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -489,7 +489,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
489 } 489 }
490 490
491 security_sk_classify_flow(sk, &fl); 491 security_sk_classify_flow(sk, &fl);
492 err = ip_route_output_flow(&rt, &fl, sk, !(msg->msg_flags&MSG_DONTWAIT)); 492 err = ip_route_output_flow(&rt, &fl, sk, 1);
493 } 493 }
494 if (err) 494 if (err)
495 goto done; 495 goto done;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index f061ec50d8bc..383e4b52dbde 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -191,7 +191,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
191 tmp = ip_route_connect(&rt, nexthop, inet->saddr, 191 tmp = ip_route_connect(&rt, nexthop, inet->saddr,
192 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, 192 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
193 IPPROTO_TCP, 193 IPPROTO_TCP,
194 inet->sport, usin->sin_port, sk); 194 inet->sport, usin->sin_port, sk, 1);
195 if (tmp < 0) 195 if (tmp < 0)
196 return tmp; 196 return tmp;
197 197
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index cfff930f2baf..8b54c68a0d12 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -629,7 +629,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
629 { .sport = inet->sport, 629 { .sport = inet->sport,
630 .dport = dport } } }; 630 .dport = dport } } };
631 security_sk_classify_flow(sk, &fl); 631 security_sk_classify_flow(sk, &fl);
632 err = ip_route_output_flow(&rt, &fl, sk, !(msg->msg_flags&MSG_DONTWAIT)); 632 err = ip_route_output_flow(&rt, &fl, sk, 1);
633 if (err) 633 if (err)
634 goto out; 634 goto out;
635 635
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 5c94fea90e97..ecde30140f4a 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -178,7 +178,7 @@ ipv4_connected:
178 if (final_p) 178 if (final_p)
179 ipv6_addr_copy(&fl.fl6_dst, final_p); 179 ipv6_addr_copy(&fl.fl6_dst, final_p);
180 180
181 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 181 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0)
182 goto out; 182 goto out;
183 183
184 /* source address lookup done in ip6_dst_lookup */ 184 /* source address lookup done in ip6_dst_lookup */
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 4ae1b19ada5d..f2e883c9368a 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -815,7 +815,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
815 if (final_p) 815 if (final_p)
816 ipv6_addr_copy(&fl.fl6_dst, final_p); 816 ipv6_addr_copy(&fl.fl6_dst, final_p);
817 817
818 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 818 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0)
819 goto out; 819 goto out;
820 820
821 if (hlimit < 0) { 821 if (hlimit < 0) {
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index c25e930c2c69..dcb7b00a737d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -265,7 +265,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
265 if (final_p) 265 if (final_p)
266 ipv6_addr_copy(&fl.fl6_dst, final_p); 266 ipv6_addr_copy(&fl.fl6_dst, final_p);
267 267
268 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 268 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0)
269 goto failure; 269 goto failure;
270 270
271 if (saddr == NULL) { 271 if (saddr == NULL) {
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f52a5c3cc0a3..15e5195549cb 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -736,7 +736,7 @@ do_udp_sendmsg:
736 if (final_p) 736 if (final_p)
737 ipv6_addr_copy(&fl.fl6_dst, final_p); 737 ipv6_addr_copy(&fl.fl6_dst, final_p);
738 738
739 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 739 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0)
740 goto out; 740 goto out;
741 741
742 if (hlimit < 0) { 742 if (hlimit < 0) {