diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 6c0b7f4a3d7d..f784608a4c45 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -356,20 +356,14 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, | |||
356 | struct rtable *rt; | 356 | struct rtable *rt; |
357 | const struct inet_request_sock *ireq = inet_rsk(req); | 357 | const struct inet_request_sock *ireq = inet_rsk(req); |
358 | struct ip_options *opt = inet_rsk(req)->opt; | 358 | struct ip_options *opt = inet_rsk(req)->opt; |
359 | struct flowi4 fl4 = { | ||
360 | .flowi4_oif = sk->sk_bound_dev_if, | ||
361 | .flowi4_mark = sk->sk_mark, | ||
362 | .daddr = ((opt && opt->srr) ? | ||
363 | opt->faddr : ireq->rmt_addr), | ||
364 | .saddr = ireq->loc_addr, | ||
365 | .flowi4_tos = RT_CONN_FLAGS(sk), | ||
366 | .flowi4_proto = sk->sk_protocol, | ||
367 | .flowi4_flags = inet_sk_flowi_flags(sk), | ||
368 | .fl4_sport = inet_sk(sk)->inet_sport, | ||
369 | .fl4_dport = ireq->rmt_port, | ||
370 | }; | ||
371 | struct net *net = sock_net(sk); | 359 | struct net *net = sock_net(sk); |
360 | struct flowi4 fl4; | ||
372 | 361 | ||
362 | flowi4_init_output(&fl4, sk->sk_bound_dev_if, sk->sk_mark, | ||
363 | RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE, | ||
364 | sk->sk_protocol, inet_sk_flowi_flags(sk), | ||
365 | (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, | ||
366 | ireq->loc_addr, ireq->rmt_port, inet_sk(sk)->inet_sport); | ||
373 | security_req_classify_flow(req, flowi4_to_flowi(&fl4)); | 367 | security_req_classify_flow(req, flowi4_to_flowi(&fl4)); |
374 | rt = ip_route_output_flow(net, &fl4, sk); | 368 | rt = ip_route_output_flow(net, &fl4, sk); |
375 | if (IS_ERR(rt)) | 369 | if (IS_ERR(rt)) |