aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-01 17:27:04 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-01 17:27:04 -0500
commit273447b352e69c327efdecfd6e1d6fe3edbdcd14 (patch)
treedae1e0778ca973c25b74fd3dc9728616d6e65b73
parent5df65e5567a497a28067019b8ff08f98fb026629 (diff)
ipv4: Kill can_sleep arg to ip_route_output_flow()
This boolean state is now available in the flow flags. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c2
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c2
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c2
-rw-r--r--include/net/route.h6
-rw-r--r--net/dccp/ipv4.c2
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/inet_connection_sock.c2
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/route.c7
-rw-r--r--net/ipv4/udp.c2
-rw-r--r--net/l2tp/l2tp_ip.c2
12 files changed, 17 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index c7f776c8b2b8..e654285aa6ba 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -354,7 +354,7 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
354 } 354 }
355 }; 355 };
356 356
357 if (ip_route_output_flow(&init_net, &rt, &fl, NULL, false)) 357 if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
358 return NULL; 358 return NULL;
359 return rt; 359 return rt;
360} 360}
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 5542c994338d..7e0484f18db5 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -331,7 +331,7 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
331 } 331 }
332 }; 332 };
333 333
334 if (ip_route_output_flow(&init_net, &rt, &fl, NULL, false)) 334 if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
335 return NULL; 335 return NULL;
336 return rt; 336 return rt;
337} 337}
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index fabca75ac2f2..261aa817bdd5 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -470,7 +470,7 @@ static struct rtable *find_route_ipv4(__be32 saddr, __be32 daddr,
470 } 470 }
471 }; 471 };
472 472
473 if (ip_route_output_flow(&init_net, &rt, &fl, NULL, false)) 473 if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
474 return NULL; 474 return NULL;
475 475
476 return rt; 476 return rt;
diff --git a/include/net/route.h b/include/net/route.h
index 1be5c05a0905..923e670586d4 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -120,7 +120,7 @@ extern void rt_cache_flush(struct net *net, int how);
120extern void rt_cache_flush_batch(struct net *net); 120extern void rt_cache_flush_batch(struct net *net);
121extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); 121extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
122extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); 122extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
123extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, bool can_sleep); 123extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk);
124 124
125extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, 125extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src,
126 u8 tos, struct net_device *devin, bool noref); 126 u8 tos, struct net_device *devin, bool noref);
@@ -198,7 +198,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
198 *rp = NULL; 198 *rp = NULL;
199 } 199 }
200 security_sk_classify_flow(sk, &fl); 200 security_sk_classify_flow(sk, &fl);
201 return ip_route_output_flow(net, rp, &fl, sk, can_sleep); 201 return ip_route_output_flow(net, rp, &fl, sk);
202} 202}
203 203
204static inline int ip_route_newports(struct rtable **rp, u8 protocol, 204static inline int ip_route_newports(struct rtable **rp, u8 protocol,
@@ -222,7 +222,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
222 ip_rt_put(*rp); 222 ip_rt_put(*rp);
223 *rp = NULL; 223 *rp = NULL;
224 security_sk_classify_flow(sk, &fl); 224 security_sk_classify_flow(sk, &fl);
225 return ip_route_output_flow(sock_net(sk), rp, &fl, sk, false); 225 return ip_route_output_flow(sock_net(sk), rp, &fl, sk);
226 } 226 }
227 return 0; 227 return 0;
228} 228}
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 3d4b82f6adfd..a8ff95502081 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -475,7 +475,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
475 }; 475 };
476 476
477 security_skb_classify_flow(skb, &fl); 477 security_skb_classify_flow(skb, &fl);
478 if (ip_route_output_flow(net, &rt, &fl, sk, false)) { 478 if (ip_route_output_flow(net, &rt, &fl, sk)) {
479 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); 479 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
480 return NULL; 480 return NULL;
481 } 481 }
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 7d90fe0ee5a6..44513bb8ac2e 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1174,7 +1174,7 @@ int inet_sk_rebuild_header(struct sock *sk)
1174 }; 1174 };
1175 1175
1176 security_sk_classify_flow(sk, &fl); 1176 security_sk_classify_flow(sk, &fl);
1177 err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, false); 1177 err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk);
1178} 1178}
1179 if (!err) 1179 if (!err)
1180 sk_setup_caps(sk, &rt->dst); 1180 sk_setup_caps(sk, &rt->dst);
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 0caeb69de4b1..7f85d4aec26a 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -369,7 +369,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
369 struct net *net = sock_net(sk); 369 struct net *net = sock_net(sk);
370 370
371 security_req_classify_flow(req, &fl); 371 security_req_classify_flow(req, &fl);
372 if (ip_route_output_flow(net, &rt, &fl, sk, false)) 372 if (ip_route_output_flow(net, &rt, &fl, sk))
373 goto no_route; 373 goto no_route;
374 if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) 374 if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway)
375 goto route_err; 375 goto route_err;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index e6905c562fb7..68dbe2d93d9d 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -355,7 +355,7 @@ int ip_queue_xmit(struct sk_buff *skb)
355 * itself out. 355 * itself out.
356 */ 356 */
357 security_sk_classify_flow(sk, &fl); 357 security_sk_classify_flow(sk, &fl);
358 if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk, false)) 358 if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk))
359 goto no_route; 359 goto no_route;
360 } 360 }
361 sk_setup_caps(sk, &rt->dst); 361 sk_setup_caps(sk, &rt->dst);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index e8e8613bcbcc..d7a2d1eaec09 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -564,7 +564,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
564 } 564 }
565 565
566 security_sk_classify_flow(sk, &fl); 566 security_sk_classify_flow(sk, &fl);
567 err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, true); 567 err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk);
568 } 568 }
569 if (err) 569 if (err)
570 goto done; 570 goto done;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1ac3ecaf36e8..78462658fccb 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2720,7 +2720,7 @@ static int ipv4_dst_blackhole(struct net *net, struct rtable **rp, struct flowi
2720} 2720}
2721 2721
2722int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp, 2722int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
2723 struct sock *sk, bool can_sleep) 2723 struct sock *sk)
2724{ 2724{
2725 int err; 2725 int err;
2726 2726
@@ -2733,7 +2733,8 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
2733 if (!flp->fl4_dst) 2733 if (!flp->fl4_dst)
2734 flp->fl4_dst = (*rp)->rt_dst; 2734 flp->fl4_dst = (*rp)->rt_dst;
2735 err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk, 2735 err = __xfrm_lookup(net, (struct dst_entry **)rp, flp, sk,
2736 can_sleep ? XFRM_LOOKUP_WAIT : 0); 2736 ((flp->flags & FLOWI_FLAG_CAN_SLEEP) ?
2737 XFRM_LOOKUP_WAIT : 0));
2737 if (err == -EREMOTE) 2738 if (err == -EREMOTE)
2738 err = ipv4_dst_blackhole(net, rp, flp); 2739 err = ipv4_dst_blackhole(net, rp, flp);
2739 2740
@@ -2746,7 +2747,7 @@ EXPORT_SYMBOL_GPL(ip_route_output_flow);
2746 2747
2747int ip_route_output_key(struct net *net, struct rtable **rp, struct flowi *flp) 2748int ip_route_output_key(struct net *net, struct rtable **rp, struct flowi *flp)
2748{ 2749{
2749 return ip_route_output_flow(net, rp, flp, NULL, false); 2750 return ip_route_output_flow(net, rp, flp, NULL);
2750} 2751}
2751EXPORT_SYMBOL(ip_route_output_key); 2752EXPORT_SYMBOL(ip_route_output_key);
2752 2753
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index c6bcc93debd5..ed9a5b7bee53 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -922,7 +922,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
922 struct net *net = sock_net(sk); 922 struct net *net = sock_net(sk);
923 923
924 security_sk_classify_flow(sk, &fl); 924 security_sk_classify_flow(sk, &fl);
925 err = ip_route_output_flow(net, &rt, &fl, sk, true); 925 err = ip_route_output_flow(net, &rt, &fl, sk);
926 if (err) { 926 if (err) {
927 if (err == -ENETUNREACH) 927 if (err == -ENETUNREACH)
928 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); 928 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 7744a8e4b4c6..5381cebe516d 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -489,7 +489,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
489 * itself out. 489 * itself out.
490 */ 490 */
491 security_sk_classify_flow(sk, &fl); 491 security_sk_classify_flow(sk, &fl);
492 if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk, false)) 492 if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk))
493 goto no_route; 493 goto no_route;
494 } 494 }
495 sk_setup_caps(sk, &rt->dst); 495 sk_setup_caps(sk, &rt->dst);