Commit abdf7e72 authored by David S. Miller's avatar David S. Miller
Browse files

ipv4: Can final ip_route_connect() arg to boolean "can_sleep".



Since that's what the current vague "flags" thing means.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68d0c6d3
...@@ -168,7 +168,7 @@ static inline char rt_tos2priority(u8 tos) ...@@ -168,7 +168,7 @@ static inline char rt_tos2priority(u8 tos)
static inline int ip_route_connect(struct rtable **rp, __be32 dst, static inline int ip_route_connect(struct rtable **rp, __be32 dst,
__be32 src, u32 tos, int oif, u8 protocol, __be32 src, u32 tos, int oif, u8 protocol,
__be16 sport, __be16 dport, struct sock *sk, __be16 sport, __be16 dport, struct sock *sk,
int flags) bool can_sleep)
{ {
struct flowi fl = { .oif = oif, struct flowi fl = { .oif = oif,
.mark = sk->sk_mark, .mark = sk->sk_mark,
...@@ -196,7 +196,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, ...@@ -196,7 +196,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, flags); return ip_route_output_flow(net, rp, &fl, sk, can_sleep ? 1 : 0);
} }
static inline int ip_route_newports(struct rtable **rp, u8 protocol, static inline int ip_route_newports(struct rtable **rp, u8 protocol,
......
...@@ -69,7 +69,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -69,7 +69,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
tmp = ip_route_connect(&rt, nexthop, inet->inet_saddr, tmp = ip_route_connect(&rt, nexthop, inet->inet_saddr,
RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
IPPROTO_DCCP, IPPROTO_DCCP,
orig_sport, orig_dport, sk, 1); orig_sport, orig_dport, sk, true);
if (tmp < 0) if (tmp < 0)
return tmp; return tmp;
......
...@@ -1115,7 +1115,7 @@ static int inet_sk_reselect_saddr(struct sock *sk) ...@@ -1115,7 +1115,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)
RT_CONN_FLAGS(sk), RT_CONN_FLAGS(sk),
sk->sk_bound_dev_if, sk->sk_bound_dev_if,
sk->sk_protocol, sk->sk_protocol,
inet->inet_sport, inet->inet_dport, sk, 0); inet->inet_sport, inet->inet_dport, sk, false);
if (err) if (err)
return err; return err;
......
...@@ -49,7 +49,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -49,7 +49,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr, err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr,
RT_CONN_FLAGS(sk), oif, RT_CONN_FLAGS(sk), oif,
sk->sk_protocol, sk->sk_protocol,
inet->inet_sport, usin->sin_port, sk, 1); inet->inet_sport, usin->sin_port, sk, true);
if (err) { if (err) {
if (err == -ENETUNREACH) if (err == -ENETUNREACH)
IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES); IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
......
...@@ -173,7 +173,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -173,7 +173,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
tmp = ip_route_connect(&rt, nexthop, inet->inet_saddr, tmp = ip_route_connect(&rt, nexthop, inet->inet_saddr,
RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
IPPROTO_TCP, IPPROTO_TCP,
orig_sport, orig_dport, sk, 1); orig_sport, orig_dport, sk, true);
if (tmp < 0) { if (tmp < 0) {
if (tmp == -ENETUNREACH) if (tmp == -ENETUNREACH)
IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES); IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
......
...@@ -323,7 +323,7 @@ static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len ...@@ -323,7 +323,7 @@ static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len
rc = ip_route_connect(&rt, lsa->l2tp_addr.s_addr, saddr, rc = ip_route_connect(&rt, lsa->l2tp_addr.s_addr, saddr,
RT_CONN_FLAGS(sk), oif, RT_CONN_FLAGS(sk), oif,
IPPROTO_L2TP, IPPROTO_L2TP,
0, 0, sk, 1); 0, 0, sk, true);
if (rc) { if (rc) {
if (rc == -ENETUNREACH) if (rc == -ENETUNREACH)
IP_INC_STATS_BH(&init_net, IPSTATS_MIB_OUTNOROUTES); IP_INC_STATS_BH(&init_net, IPSTATS_MIB_OUTNOROUTES);
......
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