aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h43
1 files changed, 23 insertions, 20 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 3d814f84abd0..4c207f9fe0cb 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -157,8 +157,8 @@ static inline struct rtable *ip_route_output_ports(struct net *net, struct sock
157 .fl4_src = saddr, 157 .fl4_src = saddr,
158 .fl4_tos = tos, 158 .fl4_tos = tos,
159 .flowi_proto = proto, 159 .flowi_proto = proto,
160 .fl_ip_dport = dport, 160 .fl4_dport = dport,
161 .fl_ip_sport = sport, 161 .fl4_sport = sport,
162 }; 162 };
163 if (sk) 163 if (sk)
164 security_sk_classify_flow(sk, &fl); 164 security_sk_classify_flow(sk, &fl);
@@ -175,7 +175,7 @@ static inline struct rtable *ip_route_output_gre(struct net *net,
175 .fl4_src = saddr, 175 .fl4_src = saddr,
176 .fl4_tos = tos, 176 .fl4_tos = tos,
177 .flowi_proto = IPPROTO_GRE, 177 .flowi_proto = IPPROTO_GRE,
178 .fl_gre_key = gre_key, 178 .fl4_gre_key = gre_key,
179 }; 179 };
180 return ip_route_output_key(net, &fl); 180 return ip_route_output_key(net, &fl);
181} 181}
@@ -228,14 +228,16 @@ static inline struct rtable *ip_route_connect(__be32 dst, __be32 src, u32 tos,
228 __be16 sport, __be16 dport, 228 __be16 sport, __be16 dport,
229 struct sock *sk, bool can_sleep) 229 struct sock *sk, bool can_sleep)
230{ 230{
231 struct flowi fl = { .flowi_oif = oif, 231 struct flowi fl = {
232 .flowi_mark = sk->sk_mark, 232 .flowi_oif = oif,
233 .fl4_dst = dst, 233 .flowi_mark = sk->sk_mark,
234 .fl4_src = src, 234 .fl4_dst = dst,
235 .fl4_tos = tos, 235 .fl4_src = src,
236 .flowi_proto = protocol, 236 .fl4_tos = tos,
237 .fl_ip_sport = sport, 237 .flowi_proto = protocol,
238 .fl_ip_dport = dport }; 238 .fl4_sport = sport,
239 .fl4_dport = dport,
240 };
239 struct net *net = sock_net(sk); 241 struct net *net = sock_net(sk);
240 struct rtable *rt; 242 struct rtable *rt;
241 243
@@ -264,15 +266,16 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
264 __be16 dport, struct sock *sk) 266 __be16 dport, struct sock *sk)
265{ 267{
266 if (sport != orig_sport || dport != orig_dport) { 268 if (sport != orig_sport || dport != orig_dport) {
267 struct flowi fl = { .flowi_oif = rt->rt_oif, 269 struct flowi fl = {
268 .flowi_mark = rt->rt_mark, 270 .flowi_oif = rt->rt_oif,
269 .fl4_dst = rt->rt_key_dst, 271 .flowi_mark = rt->rt_mark,
270 .fl4_src = rt->rt_key_src, 272 .fl4_dst = rt->rt_key_dst,
271 .fl4_tos = rt->rt_tos, 273 .fl4_src = rt->rt_key_src,
272 .flowi_proto = protocol, 274 .fl4_tos = rt->rt_tos,
273 .fl_ip_sport = sport, 275 .flowi_proto = protocol,
274 .fl_ip_dport = dport }; 276 .fl4_sport = sport,
275 277 .fl4_dport = dport
278 };
276 if (inet_sk(sk)->transparent) 279 if (inet_sk(sk)->transparent)
277 fl.flowi_flags |= FLOWI_FLAG_ANYSRC; 280 fl.flowi_flags |= FLOWI_FLAG_ANYSRC;
278 if (protocol == IPPROTO_TCP) 281 if (protocol == IPPROTO_TCP)