diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2013-08-28 02:04:14 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2013-12-06 01:24:39 -0500 |
commit | 0e0d44ab4275549998567cd4700b43f7496eb62b (patch) | |
tree | 2b508851d3c8c76f7068c519e0b5c8ad31d21eec | |
parent | 5b8ef3415a21f173ab115e90ec92c071a03f22d7 (diff) |
net: Remove FLOWI_FLAG_CAN_SLEEP
FLOWI_FLAG_CAN_SLEEP was used to notify xfrm about the posibility
to sleep until the needed states are resolved. This code is gone,
so FLOWI_FLAG_CAN_SLEEP is not needed anymore.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | include/net/flow.h | 3 | ||||
-rw-r--r-- | include/net/ipv6.h | 6 | ||||
-rw-r--r-- | include/net/route.h | 8 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 2 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 8 | ||||
-rw-r--r-- | net/decnet/dn_route.c | 2 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 2 | ||||
-rw-r--r-- | net/ipv4/datagram.c | 2 | ||||
-rw-r--r-- | net/ipv4/raw.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 2 | ||||
-rw-r--r-- | net/ipv6/datagram.c | 2 | ||||
-rw-r--r-- | net/ipv6/inet6_connection_sock.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 12 | ||||
-rw-r--r-- | net/ipv6/ping.c | 2 | ||||
-rw-r--r-- | net/ipv6/raw.c | 2 | ||||
-rw-r--r-- | net/ipv6/syncookies.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 4 | ||||
-rw-r--r-- | net/ipv6/udp.c | 2 | ||||
-rw-r--r-- | net/l2tp/l2tp_ip6.c | 2 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 4 |
22 files changed, 31 insertions, 46 deletions
diff --git a/include/net/flow.h b/include/net/flow.h index 65ce471d2ab5..d23e7fa2042e 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -20,8 +20,7 @@ struct flowi_common { | |||
20 | __u8 flowic_proto; | 20 | __u8 flowic_proto; |
21 | __u8 flowic_flags; | 21 | __u8 flowic_flags; |
22 | #define FLOWI_FLAG_ANYSRC 0x01 | 22 | #define FLOWI_FLAG_ANYSRC 0x01 |
23 | #define FLOWI_FLAG_CAN_SLEEP 0x02 | 23 | #define FLOWI_FLAG_KNOWN_NH 0x02 |
24 | #define FLOWI_FLAG_KNOWN_NH 0x04 | ||
25 | __u32 flowic_secid; | 24 | __u32 flowic_secid; |
26 | }; | 25 | }; |
27 | 26 | ||
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index eb198acaac1d..26c4199ddc36 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -711,11 +711,9 @@ void ip6_flush_pending_frames(struct sock *sk); | |||
711 | 711 | ||
712 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); | 712 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); |
713 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 713 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
714 | const struct in6_addr *final_dst, | 714 | const struct in6_addr *final_dst); |
715 | bool can_sleep); | ||
716 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 715 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
717 | const struct in6_addr *final_dst, | 716 | const struct in6_addr *final_dst); |
718 | bool can_sleep); | ||
719 | struct dst_entry *ip6_blackhole_route(struct net *net, | 717 | struct dst_entry *ip6_blackhole_route(struct net *net, |
720 | struct dst_entry *orig_dst); | 718 | struct dst_entry *orig_dst); |
721 | 719 | ||
diff --git a/include/net/route.h b/include/net/route.h index f68c167280a7..638e3ebf76f3 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -239,14 +239,12 @@ static inline char rt_tos2priority(u8 tos) | |||
239 | static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, | 239 | static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, |
240 | u32 tos, int oif, u8 protocol, | 240 | u32 tos, int oif, u8 protocol, |
241 | __be16 sport, __be16 dport, | 241 | __be16 sport, __be16 dport, |
242 | struct sock *sk, bool can_sleep) | 242 | struct sock *sk) |
243 | { | 243 | { |
244 | __u8 flow_flags = 0; | 244 | __u8 flow_flags = 0; |
245 | 245 | ||
246 | if (inet_sk(sk)->transparent) | 246 | if (inet_sk(sk)->transparent) |
247 | flow_flags |= FLOWI_FLAG_ANYSRC; | 247 | flow_flags |= FLOWI_FLAG_ANYSRC; |
248 | if (can_sleep) | ||
249 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
250 | 248 | ||
251 | flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, | 249 | flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, |
252 | protocol, flow_flags, dst, src, dport, sport); | 250 | protocol, flow_flags, dst, src, dport, sport); |
@@ -256,13 +254,13 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4, | |||
256 | __be32 dst, __be32 src, u32 tos, | 254 | __be32 dst, __be32 src, u32 tos, |
257 | int oif, u8 protocol, | 255 | int oif, u8 protocol, |
258 | __be16 sport, __be16 dport, | 256 | __be16 sport, __be16 dport, |
259 | struct sock *sk, bool can_sleep) | 257 | struct sock *sk) |
260 | { | 258 | { |
261 | struct net *net = sock_net(sk); | 259 | struct net *net = sock_net(sk); |
262 | struct rtable *rt; | 260 | struct rtable *rt; |
263 | 261 | ||
264 | ip_route_connect_init(fl4, dst, src, tos, oif, protocol, | 262 | ip_route_connect_init(fl4, dst, src, tos, oif, protocol, |
265 | sport, dport, sk, can_sleep); | 263 | sport, dport, sk); |
266 | 264 | ||
267 | if (!dst || !src) { | 265 | if (!dst || !src) { |
268 | rt = __ip_route_output_key(net, fl4); | 266 | rt = __ip_route_output_key(net, fl4); |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index d9f65fc66db5..88299c29101d 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -75,7 +75,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
75 | rt = ip_route_connect(fl4, nexthop, inet->inet_saddr, | 75 | rt = ip_route_connect(fl4, nexthop, inet->inet_saddr, |
76 | RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, | 76 | RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, |
77 | IPPROTO_DCCP, | 77 | IPPROTO_DCCP, |
78 | orig_sport, orig_dport, sk, true); | 78 | orig_sport, orig_dport, sk); |
79 | if (IS_ERR(rt)) | 79 | if (IS_ERR(rt)) |
80 | return PTR_ERR(rt); | 80 | return PTR_ERR(rt); |
81 | 81 | ||
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 4ac71ff7c2e4..699a2d2a35ea 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -237,7 +237,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req) | |||
237 | 237 | ||
238 | final_p = fl6_update_dst(&fl6, np->opt, &final); | 238 | final_p = fl6_update_dst(&fl6, np->opt, &final); |
239 | 239 | ||
240 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); | 240 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
241 | if (IS_ERR(dst)) { | 241 | if (IS_ERR(dst)) { |
242 | err = PTR_ERR(dst); | 242 | err = PTR_ERR(dst); |
243 | dst = NULL; | 243 | dst = NULL; |
@@ -301,7 +301,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | |||
301 | security_skb_classify_flow(rxskb, flowi6_to_flowi(&fl6)); | 301 | security_skb_classify_flow(rxskb, flowi6_to_flowi(&fl6)); |
302 | 302 | ||
303 | /* sk = NULL, but it is safe for now. RST socket required. */ | 303 | /* sk = NULL, but it is safe for now. RST socket required. */ |
304 | dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL, false); | 304 | dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL); |
305 | if (!IS_ERR(dst)) { | 305 | if (!IS_ERR(dst)) { |
306 | skb_dst_set(skb, dst); | 306 | skb_dst_set(skb, dst); |
307 | ip6_xmit(ctl_sk, skb, &fl6, NULL, 0); | 307 | ip6_xmit(ctl_sk, skb, &fl6, NULL, 0); |
@@ -512,7 +512,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
512 | fl6.fl6_sport = htons(ireq->ir_num); | 512 | fl6.fl6_sport = htons(ireq->ir_num); |
513 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 513 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
514 | 514 | ||
515 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); | 515 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
516 | if (IS_ERR(dst)) | 516 | if (IS_ERR(dst)) |
517 | goto out; | 517 | goto out; |
518 | } | 518 | } |
@@ -932,7 +932,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
932 | 932 | ||
933 | final_p = fl6_update_dst(&fl6, np->opt, &final); | 933 | final_p = fl6_update_dst(&fl6, np->opt, &final); |
934 | 934 | ||
935 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true); | 935 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
936 | if (IS_ERR(dst)) { | 936 | if (IS_ERR(dst)) { |
937 | err = PTR_ERR(dst); | 937 | err = PTR_ERR(dst); |
938 | goto failure; | 938 | goto failure; |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index fe32388ea24f..ad2efa5b861b 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -1288,8 +1288,6 @@ int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *fl, stru | |||
1288 | 1288 | ||
1289 | err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD); | 1289 | err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD); |
1290 | if (err == 0 && fl->flowidn_proto) { | 1290 | if (err == 0 && fl->flowidn_proto) { |
1291 | if (!(flags & MSG_DONTWAIT)) | ||
1292 | fl->flowidn_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
1293 | *pprt = xfrm_lookup(&init_net, *pprt, | 1291 | *pprt = xfrm_lookup(&init_net, *pprt, |
1294 | flowidn_to_flowi(fl), sk, 0); | 1292 | flowidn_to_flowi(fl), sk, 0); |
1295 | if (IS_ERR(*pprt)) { | 1293 | if (IS_ERR(*pprt)) { |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 70011e029ac1..4f6d50bda093 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1133,7 +1133,7 @@ static int inet_sk_reselect_saddr(struct sock *sk) | |||
1133 | fl4 = &inet->cork.fl.u.ip4; | 1133 | fl4 = &inet->cork.fl.u.ip4; |
1134 | rt = ip_route_connect(fl4, daddr, 0, RT_CONN_FLAGS(sk), | 1134 | rt = ip_route_connect(fl4, daddr, 0, RT_CONN_FLAGS(sk), |
1135 | sk->sk_bound_dev_if, sk->sk_protocol, | 1135 | sk->sk_bound_dev_if, sk->sk_protocol, |
1136 | inet->inet_sport, inet->inet_dport, sk, false); | 1136 | inet->inet_sport, inet->inet_dport, sk); |
1137 | if (IS_ERR(rt)) | 1137 | if (IS_ERR(rt)) |
1138 | return PTR_ERR(rt); | 1138 | return PTR_ERR(rt); |
1139 | 1139 | ||
diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c index 19e36376d2a0..8b5134c582f1 100644 --- a/net/ipv4/datagram.c +++ b/net/ipv4/datagram.c | |||
@@ -53,7 +53,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
53 | rt = ip_route_connect(fl4, usin->sin_addr.s_addr, saddr, | 53 | rt = ip_route_connect(fl4, usin->sin_addr.s_addr, saddr, |
54 | RT_CONN_FLAGS(sk), oif, | 54 | RT_CONN_FLAGS(sk), oif, |
55 | sk->sk_protocol, | 55 | sk->sk_protocol, |
56 | inet->inet_sport, usin->sin_port, sk, true); | 56 | inet->inet_sport, usin->sin_port, sk); |
57 | if (IS_ERR(rt)) { | 57 | if (IS_ERR(rt)) { |
58 | err = PTR_ERR(rt); | 58 | err = PTR_ERR(rt); |
59 | if (err == -ENETUNREACH) | 59 | if (err == -ENETUNREACH) |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 23c3e5b5bb53..81e6cfd5a365 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -575,7 +575,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
575 | flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, | 575 | flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, |
576 | RT_SCOPE_UNIVERSE, | 576 | RT_SCOPE_UNIVERSE, |
577 | inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol, | 577 | inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol, |
578 | inet_sk_flowi_flags(sk) | FLOWI_FLAG_CAN_SLEEP | | 578 | inet_sk_flowi_flags(sk) | |
579 | (inet->hdrincl ? FLOWI_FLAG_KNOWN_NH : 0), | 579 | (inet->hdrincl ? FLOWI_FLAG_KNOWN_NH : 0), |
580 | daddr, saddr, 0, 0); | 580 | daddr, saddr, 0, 0); |
581 | 581 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 067213924751..bbaf8cb45eb2 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -173,7 +173,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
173 | rt = ip_route_connect(fl4, nexthop, inet->inet_saddr, | 173 | rt = ip_route_connect(fl4, nexthop, inet->inet_saddr, |
174 | RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, | 174 | RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, |
175 | IPPROTO_TCP, | 175 | IPPROTO_TCP, |
176 | orig_sport, orig_dport, sk, true); | 176 | orig_sport, orig_dport, sk); |
177 | if (IS_ERR(rt)) { | 177 | if (IS_ERR(rt)) { |
178 | err = PTR_ERR(rt); | 178 | err = PTR_ERR(rt); |
179 | if (err == -ENETUNREACH) | 179 | if (err == -ENETUNREACH) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 44f6a20fa29d..480fb95df2b6 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -990,7 +990,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
990 | fl4 = &fl4_stack; | 990 | fl4 = &fl4_stack; |
991 | flowi4_init_output(fl4, ipc.oif, sk->sk_mark, tos, | 991 | flowi4_init_output(fl4, ipc.oif, sk->sk_mark, tos, |
992 | RT_SCOPE_UNIVERSE, sk->sk_protocol, | 992 | RT_SCOPE_UNIVERSE, sk->sk_protocol, |
993 | inet_sk_flowi_flags(sk)|FLOWI_FLAG_CAN_SLEEP, | 993 | inet_sk_flowi_flags(sk), |
994 | faddr, saddr, dport, inet->inet_sport); | 994 | faddr, saddr, dport, inet->inet_sport); |
995 | 995 | ||
996 | security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); | 996 | security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 4fbdb7046d28..c33f98a4cf72 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -661,7 +661,7 @@ int inet6_sk_rebuild_header(struct sock *sk) | |||
661 | 661 | ||
662 | final_p = fl6_update_dst(&fl6, np->opt, &final); | 662 | final_p = fl6_update_dst(&fl6, np->opt, &final); |
663 | 663 | ||
664 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); | 664 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
665 | if (IS_ERR(dst)) { | 665 | if (IS_ERR(dst)) { |
666 | sk->sk_route_caps = 0; | 666 | sk->sk_route_caps = 0; |
667 | sk->sk_err_soft = -PTR_ERR(dst); | 667 | sk->sk_err_soft = -PTR_ERR(dst); |
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 8dfe1f4d3c1a..d7ef682cd984 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -171,7 +171,7 @@ ipv4_connected: | |||
171 | opt = flowlabel ? flowlabel->opt : np->opt; | 171 | opt = flowlabel ? flowlabel->opt : np->opt; |
172 | final_p = fl6_update_dst(&fl6, opt, &final); | 172 | final_p = fl6_update_dst(&fl6, opt, &final); |
173 | 173 | ||
174 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true); | 174 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
175 | err = 0; | 175 | err = 0; |
176 | if (IS_ERR(dst)) { | 176 | if (IS_ERR(dst)) { |
177 | err = PTR_ERR(dst); | 177 | err = PTR_ERR(dst); |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 77bb8afb141d..c9138189415a 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -86,7 +86,7 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk, | |||
86 | fl6->fl6_sport = htons(ireq->ir_num); | 86 | fl6->fl6_sport = htons(ireq->ir_num); |
87 | security_req_classify_flow(req, flowi6_to_flowi(fl6)); | 87 | security_req_classify_flow(req, flowi6_to_flowi(fl6)); |
88 | 88 | ||
89 | dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); | 89 | dst = ip6_dst_lookup_flow(sk, fl6, final_p); |
90 | if (IS_ERR(dst)) | 90 | if (IS_ERR(dst)) |
91 | return NULL; | 91 | return NULL; |
92 | 92 | ||
@@ -216,7 +216,7 @@ static struct dst_entry *inet6_csk_route_socket(struct sock *sk, | |||
216 | 216 | ||
217 | dst = __inet6_csk_dst_check(sk, np->dst_cookie); | 217 | dst = __inet6_csk_dst_check(sk, np->dst_cookie); |
218 | if (!dst) { | 218 | if (!dst) { |
219 | dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); | 219 | dst = ip6_dst_lookup_flow(sk, fl6, final_p); |
220 | 220 | ||
221 | if (!IS_ERR(dst)) | 221 | if (!IS_ERR(dst)) |
222 | __inet6_csk_dst_store(sk, dst, NULL, NULL); | 222 | __inet6_csk_dst_store(sk, dst, NULL, NULL); |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 4acdb63495db..3915cd883657 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -938,7 +938,6 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup); | |||
938 | * @sk: socket which provides route info | 938 | * @sk: socket which provides route info |
939 | * @fl6: flow to lookup | 939 | * @fl6: flow to lookup |
940 | * @final_dst: final destination address for ipsec lookup | 940 | * @final_dst: final destination address for ipsec lookup |
941 | * @can_sleep: we are in a sleepable context | ||
942 | * | 941 | * |
943 | * This function performs a route lookup on the given flow. | 942 | * This function performs a route lookup on the given flow. |
944 | * | 943 | * |
@@ -946,8 +945,7 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup); | |||
946 | * error code. | 945 | * error code. |
947 | */ | 946 | */ |
948 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 947 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
949 | const struct in6_addr *final_dst, | 948 | const struct in6_addr *final_dst) |
950 | bool can_sleep) | ||
951 | { | 949 | { |
952 | struct dst_entry *dst = NULL; | 950 | struct dst_entry *dst = NULL; |
953 | int err; | 951 | int err; |
@@ -957,8 +955,6 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
957 | return ERR_PTR(err); | 955 | return ERR_PTR(err); |
958 | if (final_dst) | 956 | if (final_dst) |
959 | fl6->daddr = *final_dst; | 957 | fl6->daddr = *final_dst; |
960 | if (can_sleep) | ||
961 | fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
962 | 958 | ||
963 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); | 959 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); |
964 | } | 960 | } |
@@ -969,7 +965,6 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow); | |||
969 | * @sk: socket which provides the dst cache and route info | 965 | * @sk: socket which provides the dst cache and route info |
970 | * @fl6: flow to lookup | 966 | * @fl6: flow to lookup |
971 | * @final_dst: final destination address for ipsec lookup | 967 | * @final_dst: final destination address for ipsec lookup |
972 | * @can_sleep: we are in a sleepable context | ||
973 | * | 968 | * |
974 | * This function performs a route lookup on the given flow with the | 969 | * This function performs a route lookup on the given flow with the |
975 | * possibility of using the cached route in the socket if it is valid. | 970 | * possibility of using the cached route in the socket if it is valid. |
@@ -980,8 +975,7 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow); | |||
980 | * error code. | 975 | * error code. |
981 | */ | 976 | */ |
982 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 977 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
983 | const struct in6_addr *final_dst, | 978 | const struct in6_addr *final_dst) |
984 | bool can_sleep) | ||
985 | { | 979 | { |
986 | struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie); | 980 | struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie); |
987 | int err; | 981 | int err; |
@@ -993,8 +987,6 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
993 | return ERR_PTR(err); | 987 | return ERR_PTR(err); |
994 | if (final_dst) | 988 | if (final_dst) |
995 | fl6->daddr = *final_dst; | 989 | fl6->daddr = *final_dst; |
996 | if (can_sleep) | ||
997 | fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
998 | 990 | ||
999 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); | 991 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); |
1000 | } | 992 | } |
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index a83243c3d656..15d23b8c2129 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c | |||
@@ -145,7 +145,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
145 | else if (!fl6.flowi6_oif) | 145 | else if (!fl6.flowi6_oif) |
146 | fl6.flowi6_oif = np->ucast_oif; | 146 | fl6.flowi6_oif = np->ucast_oif; |
147 | 147 | ||
148 | dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, 1); | 148 | dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr); |
149 | if (IS_ERR(dst)) | 149 | if (IS_ERR(dst)) |
150 | return PTR_ERR(dst); | 150 | return PTR_ERR(dst); |
151 | rt = (struct rt6_info *) dst; | 151 | rt = (struct rt6_info *) dst; |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 7fb4e14c467f..4945fb6d60a2 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -865,7 +865,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
865 | fl6.flowi6_oif = np->ucast_oif; | 865 | fl6.flowi6_oif = np->ucast_oif; |
866 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 866 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
867 | 867 | ||
868 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true); | 868 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
869 | if (IS_ERR(dst)) { | 869 | if (IS_ERR(dst)) { |
870 | err = PTR_ERR(dst); | 870 | err = PTR_ERR(dst); |
871 | goto out; | 871 | goto out; |
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 535a3ad262f1..bb53a5e73c1a 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c | |||
@@ -247,7 +247,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
247 | fl6.fl6_sport = inet_sk(sk)->inet_sport; | 247 | fl6.fl6_sport = inet_sk(sk)->inet_sport; |
248 | security_req_classify_flow(req, flowi6_to_flowi(&fl6)); | 248 | security_req_classify_flow(req, flowi6_to_flowi(&fl6)); |
249 | 249 | ||
250 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); | 250 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
251 | if (IS_ERR(dst)) | 251 | if (IS_ERR(dst)) |
252 | goto out_free; | 252 | goto out_free; |
253 | } | 253 | } |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0740f93a114a..f14456f40d02 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -258,7 +258,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
258 | 258 | ||
259 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 259 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
260 | 260 | ||
261 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true); | 261 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
262 | if (IS_ERR(dst)) { | 262 | if (IS_ERR(dst)) { |
263 | err = PTR_ERR(dst); | 263 | err = PTR_ERR(dst); |
264 | goto failure; | 264 | goto failure; |
@@ -801,7 +801,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
801 | * Underlying function will use this to retrieve the network | 801 | * Underlying function will use this to retrieve the network |
802 | * namespace | 802 | * namespace |
803 | */ | 803 | */ |
804 | dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL, false); | 804 | dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL); |
805 | if (!IS_ERR(dst)) { | 805 | if (!IS_ERR(dst)) { |
806 | skb_dst_set(buff, dst); | 806 | skb_dst_set(buff, dst); |
807 | ip6_xmit(ctl_sk, buff, &fl6, NULL, tclass); | 807 | ip6_xmit(ctl_sk, buff, &fl6, NULL, tclass); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index bcd5699313c3..ec3eb7f3f87c 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1221,7 +1221,7 @@ do_udp_sendmsg: | |||
1221 | 1221 | ||
1222 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 1222 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
1223 | 1223 | ||
1224 | dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p, true); | 1224 | dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p); |
1225 | if (IS_ERR(dst)) { | 1225 | if (IS_ERR(dst)) { |
1226 | err = PTR_ERR(dst); | 1226 | err = PTR_ERR(dst); |
1227 | dst = NULL; | 1227 | dst = NULL; |
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index d9b437e55007..0c231f676049 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
@@ -598,7 +598,7 @@ static int l2tp_ip6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
598 | 598 | ||
599 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 599 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
600 | 600 | ||
601 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true); | 601 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
602 | if (IS_ERR(dst)) { | 602 | if (IS_ERR(dst)) { |
603 | err = PTR_ERR(dst); | 603 | err = PTR_ERR(dst); |
604 | goto out; | 604 | goto out; |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 7567e6f1a920..dd15caec154d 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -263,7 +263,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, | |||
263 | } | 263 | } |
264 | 264 | ||
265 | final_p = fl6_update_dst(fl6, np->opt, &final); | 265 | final_p = fl6_update_dst(fl6, np->opt, &final); |
266 | dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); | 266 | dst = ip6_dst_lookup_flow(sk, fl6, final_p); |
267 | if (!asoc || saddr) | 267 | if (!asoc || saddr) |
268 | goto out; | 268 | goto out; |
269 | 269 | ||
@@ -322,7 +322,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, | |||
322 | fl6->saddr = baddr->v6.sin6_addr; | 322 | fl6->saddr = baddr->v6.sin6_addr; |
323 | fl6->fl6_sport = baddr->v6.sin6_port; | 323 | fl6->fl6_sport = baddr->v6.sin6_port; |
324 | final_p = fl6_update_dst(fl6, np->opt, &final); | 324 | final_p = fl6_update_dst(fl6, np->opt, &final); |
325 | dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); | 325 | dst = ip6_dst_lookup_flow(sk, fl6, final_p); |
326 | } | 326 | } |
327 | 327 | ||
328 | out: | 328 | out: |