Commit 273447b3 authored by David S. Miller's avatar David S. Miller

ipv4: Kill can_sleep arg to ip_route_output_flow()

This boolean state is now available in the flow flags.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5df65e55
...@@ -354,7 +354,7 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip, ...@@ -354,7 +354,7 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
} }
}; };
if (ip_route_output_flow(&init_net, &rt, &fl, NULL, false)) if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
return NULL; return NULL;
return rt; return rt;
} }
......
...@@ -331,7 +331,7 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip, ...@@ -331,7 +331,7 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
} }
}; };
if (ip_route_output_flow(&init_net, &rt, &fl, NULL, false)) if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
return NULL; return NULL;
return rt; return rt;
} }
......
...@@ -470,7 +470,7 @@ static struct rtable *find_route_ipv4(__be32 saddr, __be32 daddr, ...@@ -470,7 +470,7 @@ static struct rtable *find_route_ipv4(__be32 saddr, __be32 daddr,
} }
}; };
if (ip_route_output_flow(&init_net, &rt, &fl, NULL, false)) if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
return NULL; return NULL;
return rt; return rt;
......
...@@ -120,7 +120,7 @@ extern void rt_cache_flush(struct net *net, int how); ...@@ -120,7 +120,7 @@ extern void rt_cache_flush(struct net *net, int how);
extern void rt_cache_flush_batch(struct net *net); extern void rt_cache_flush_batch(struct net *net);
extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, bool can_sleep); extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk);
extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src,
u8 tos, struct net_device *devin, bool noref); u8 tos, struct net_device *devin, bool noref);
...@@ -198,7 +198,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, ...@@ -198,7 +198,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
*rp = NULL; *rp = NULL;
} }
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
return ip_route_output_flow(net, rp, &fl, sk, can_sleep); return ip_route_output_flow(net, rp, &fl, sk);
} }
static inline int ip_route_newports(struct rtable **rp, u8 protocol, static 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,7 +222,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
ip_rt_put(*rp); ip_rt_put(*rp);
*rp = NULL; *rp = NULL;
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
return ip_route_output_flow(sock_net(sk), rp, &fl, sk, false); return ip_route_output_flow(sock_net(sk), rp, &fl, sk);
} }
return 0; return 0;
} }
......
...@@ -475,7 +475,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk, ...@@ -475,7 +475,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
}; };
security_skb_classify_flow(skb, &fl); security_skb_classify_flow(skb, &fl);
if (ip_route_output_flow(net, &rt, &fl, sk, false)) { if (ip_route_output_flow(net, &rt, &fl, sk)) {
IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
return NULL; return NULL;
} }
......
...@@ -1174,7 +1174,7 @@ int inet_sk_rebuild_header(struct sock *sk) ...@@ -1174,7 +1174,7 @@ int inet_sk_rebuild_header(struct sock *sk)
}; };
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, false); err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk);
} }
if (!err) if (!err)
sk_setup_caps(sk, &rt->dst); sk_setup_caps(sk, &rt->dst);
......
...@@ -369,7 +369,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, ...@@ -369,7 +369,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
security_req_classify_flow(req, &fl); security_req_classify_flow(req, &fl);
if (ip_route_output_flow(net, &rt, &fl, sk, false)) if (ip_route_output_flow(net, &rt, &fl, sk))
goto no_route; goto no_route;
if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway)
goto route_err; goto route_err;
......
...@@ -355,7 +355,7 @@ int ip_queue_xmit(struct sk_buff *skb) ...@@ -355,7 +355,7 @@ int ip_queue_xmit(struct sk_buff *skb)
* itself out. * itself out.
*/ */
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk, false)) if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk))
goto no_route; goto no_route;
} }
sk_setup_caps(sk, &rt->dst); sk_setup_caps(sk, &rt->dst);
......
...@@ -564,7 +564,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -564,7 +564,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
} }
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, true); err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk);
} }
if (err) if (err)
goto done; goto done;
......
...@@ -2720,7 +2720,7 @@ static int ipv4_dst_blackhole(struct net *net, struct rtable **rp, struct flowi ...@@ -2720,7 +2720,7 @@ static int ipv4_dst_blackhole(struct net *net, struct rtable **rp, struct flowi
} }
int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp, int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
struct sock *sk, bool can_sleep) struct sock *sk)
{ {
int err; int err;
...@@ -2733,7 +2733,8 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp, ...@@ -2733,7 +2733,8 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
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,
can_sleep ? XFRM_LOOKUP_WAIT : 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);
...@@ -2746,7 +2747,7 @@ EXPORT_SYMBOL_GPL(ip_route_output_flow); ...@@ -2746,7 +2747,7 @@ EXPORT_SYMBOL_GPL(ip_route_output_flow);
int ip_route_output_key(struct net *net, struct rtable **rp, struct flowi *flp) int ip_route_output_key(struct net *net, struct rtable **rp, struct flowi *flp)
{ {
return ip_route_output_flow(net, rp, flp, NULL, false); return ip_route_output_flow(net, rp, flp, NULL);
} }
EXPORT_SYMBOL(ip_route_output_key); EXPORT_SYMBOL(ip_route_output_key);
......
...@@ -922,7 +922,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -922,7 +922,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
err = ip_route_output_flow(net, &rt, &fl, sk, true); err = ip_route_output_flow(net, &rt, &fl, sk);
if (err) { if (err) {
if (err == -ENETUNREACH) if (err == -ENETUNREACH)
IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
......
...@@ -489,7 +489,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m ...@@ -489,7 +489,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
* itself out. * itself out.
*/ */
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk, false)) if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk))
goto no_route; goto no_route;
} }
sk_setup_caps(sk, &rt->dst); sk_setup_caps(sk, &rt->dst);
......
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