diff options
author | Eric Dumazet <edumazet@google.com> | 2015-09-29 10:42:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-29 19:53:08 -0400 |
commit | f76b33c32b1913dd8909d8509f2726b1661aa6b1 (patch) | |
tree | 6b2d005f324ed9aefdd446e533702d3c1484eba7 /net/ipv6/inet6_connection_sock.c | |
parent | 72ab4a86f7a260d4c2a320b49662da107ce77a81 (diff) |
dccp: use inet6_csk_route_req() helper
Before changing dccp_v6_request_recv_sock() sock argument
to const, we need to get rid of security_sk_classify_flow(),
and it seems doable by reusing inet6_csk_route_req() helper.
We need to add a proto parameter to inet6_csk_route_req(),
not assume it is TCP.
Signed-off-by: Eric Dumazet <edumazet@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.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 91b7d33f508b..163bfef3e5db 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -67,15 +67,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict); | |||
67 | 67 | ||
68 | struct dst_entry *inet6_csk_route_req(const struct sock *sk, | 68 | struct dst_entry *inet6_csk_route_req(const struct sock *sk, |
69 | struct flowi6 *fl6, | 69 | struct flowi6 *fl6, |
70 | const struct request_sock *req) | 70 | const struct request_sock *req, |
71 | u8 proto) | ||
71 | { | 72 | { |
72 | struct inet_request_sock *ireq = inet_rsk(req); | 73 | struct inet_request_sock *ireq = inet_rsk(req); |
73 | struct ipv6_pinfo *np = inet6_sk(sk); | 74 | const struct ipv6_pinfo *np = inet6_sk(sk); |
74 | struct in6_addr *final_p, final; | 75 | struct in6_addr *final_p, final; |
75 | struct dst_entry *dst; | 76 | struct dst_entry *dst; |
76 | 77 | ||
77 | memset(fl6, 0, sizeof(*fl6)); | 78 | memset(fl6, 0, sizeof(*fl6)); |
78 | fl6->flowi6_proto = IPPROTO_TCP; | 79 | fl6->flowi6_proto = proto; |
79 | fl6->daddr = ireq->ir_v6_rmt_addr; | 80 | fl6->daddr = ireq->ir_v6_rmt_addr; |
80 | final_p = fl6_update_dst(fl6, np->opt, &final); | 81 | final_p = fl6_update_dst(fl6, np->opt, &final); |
81 | fl6->saddr = ireq->ir_v6_loc_addr; | 82 | fl6->saddr = ireq->ir_v6_loc_addr; |
@@ -91,6 +92,7 @@ struct dst_entry *inet6_csk_route_req(const struct sock *sk, | |||
91 | 92 | ||
92 | return dst; | 93 | return dst; |
93 | } | 94 | } |
95 | EXPORT_SYMBOL(inet6_csk_route_req); | ||
94 | 96 | ||
95 | /* | 97 | /* |
96 | * request_sock (formerly open request) hash tables. | 98 | * request_sock (formerly open request) hash tables. |