aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_connection_sock.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-31 07:53:20 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-31 07:53:20 -0400
commite79d9bc7ea76e08fc24d7adaad8b6a821d1624c3 (patch)
treeb06d672f4b55d70a3602e65f09bcf2f55465651b /net/ipv4/inet_connection_sock.c
parent94b92b88344641dbeadd2ef371549b7663a48fb1 (diff)
ipv4: Use flowi4_init_output() in inet_connection_sock.c
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r--net/ipv4/inet_connection_sock.c18
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))