diff options
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 7174370b1195..06f5f8f482f0 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -358,17 +358,14 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, | |||
358 | struct ip_options *opt = inet_rsk(req)->opt; | 358 | struct ip_options *opt = inet_rsk(req)->opt; |
359 | struct flowi fl = { .oif = sk->sk_bound_dev_if, | 359 | struct flowi fl = { .oif = sk->sk_bound_dev_if, |
360 | .mark = sk->sk_mark, | 360 | .mark = sk->sk_mark, |
361 | .nl_u = { .ip4_u = | 361 | .fl4_dst = ((opt && opt->srr) ? |
362 | { .daddr = ((opt && opt->srr) ? | 362 | opt->faddr : ireq->rmt_addr), |
363 | opt->faddr : | 363 | .fl4_src = ireq->loc_addr, |
364 | ireq->rmt_addr), | 364 | .fl4_tos = RT_CONN_FLAGS(sk), |
365 | .saddr = ireq->loc_addr, | ||
366 | .tos = RT_CONN_FLAGS(sk) } }, | ||
367 | .proto = sk->sk_protocol, | 365 | .proto = sk->sk_protocol, |
368 | .flags = inet_sk_flowi_flags(sk), | 366 | .flags = inet_sk_flowi_flags(sk), |
369 | .uli_u = { .ports = | 367 | .fl_ip_sport = inet_sk(sk)->inet_sport, |
370 | { .sport = inet_sk(sk)->inet_sport, | 368 | .fl_ip_dport = ireq->rmt_port }; |
371 | .dport = ireq->rmt_port } } }; | ||
372 | struct net *net = sock_net(sk); | 369 | struct net *net = sock_net(sk); |
373 | 370 | ||
374 | security_req_classify_flow(req, &fl); | 371 | security_req_classify_flow(req, &fl); |