aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/inet6_connection_sock.c
diff options
context:
space:
mode:
authorNeal Cardwell <ncardwell@google.com>2012-06-28 08:34:19 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-28 20:53:50 -0400
commit3840a06e6046aaee95f33a120499d2dc8c054b9d (patch)
tree6a6acc85ad10729f25b4f3ac81f46facf03b978d /net/ipv6/inet6_connection_sock.c
parent9247869ee661b046510c19a36cf0d91d9c2639d3 (diff)
tcp: pass fl6 to inet6_csk_route_req()
This commit changes inet_csk_route_req() so that it uses a pointer to a struct flowi6, rather than allocating its own on the stack. This brings its behavior in line with its IPv4 cousin, inet_csk_route_req(), and allows a follow-on patch to fix a dst leak. Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/inet6_connection_sock.c')
-rw-r--r--net/ipv6/inet6_connection_sock.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index e23d35424ca9..bceb14450a1d 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -55,26 +55,26 @@ int inet6_csk_bind_conflict(const struct sock *sk,
55EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict); 55EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict);
56 56
57struct dst_entry *inet6_csk_route_req(struct sock *sk, 57struct dst_entry *inet6_csk_route_req(struct sock *sk,
58 struct flowi6 *fl6,
58 const struct request_sock *req) 59 const struct request_sock *req)
59{ 60{
60 struct inet6_request_sock *treq = inet6_rsk(req); 61 struct inet6_request_sock *treq = inet6_rsk(req);
61 struct ipv6_pinfo *np = inet6_sk(sk); 62 struct ipv6_pinfo *np = inet6_sk(sk);
62 struct in6_addr *final_p, final; 63 struct in6_addr *final_p, final;
63 struct dst_entry *dst; 64 struct dst_entry *dst;
64 struct flowi6 fl6;
65
66 memset(&fl6, 0, sizeof(fl6));
67 fl6.flowi6_proto = IPPROTO_TCP;
68 fl6.daddr = treq->rmt_addr;
69 final_p = fl6_update_dst(&fl6, np->opt, &final);
70 fl6.saddr = treq->loc_addr;
71 fl6.flowi6_oif = treq->iif;
72 fl6.flowi6_mark = sk->sk_mark;
73 fl6.fl6_dport = inet_rsk(req)->rmt_port;
74 fl6.fl6_sport = inet_rsk(req)->loc_port;
75 security_req_classify_flow(req, flowi6_to_flowi(&fl6));
76 65
77 dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); 66 memset(fl6, 0, sizeof(*fl6));
67 fl6->flowi6_proto = IPPROTO_TCP;
68 fl6->daddr = treq->rmt_addr;
69 final_p = fl6_update_dst(fl6, np->opt, &final);
70 fl6->saddr = treq->loc_addr;
71 fl6->flowi6_oif = treq->iif;
72 fl6->flowi6_mark = sk->sk_mark;
73 fl6->fl6_dport = inet_rsk(req)->rmt_port;
74 fl6->fl6_sport = inet_rsk(req)->loc_port;
75 security_req_classify_flow(req, flowi6_to_flowi(fl6));
76
77 dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);
78 if (IS_ERR(dst)) 78 if (IS_ERR(dst))
79 return NULL; 79 return NULL;
80 80