aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-09-29 10:42:42 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-29 19:53:08 -0400
commitf76b33c32b1913dd8909d8509f2726b1661aa6b1 (patch)
tree6b2d005f324ed9aefdd446e533702d3c1484eba7 /net/dccp
parent72ab4a86f7a260d4c2a320b49662da107ce77a81 (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/dccp')
-rw-r--r--net/dccp/ipv6.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index aa719e700961..0966bc08d362 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -462,22 +462,11 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
462 if (sk_acceptq_is_full(sk)) 462 if (sk_acceptq_is_full(sk))
463 goto out_overflow; 463 goto out_overflow;
464 464
465 if (dst == NULL) { 465 if (!dst) {
466 struct in6_addr *final_p, final;
467 struct flowi6 fl6; 466 struct flowi6 fl6;
468 467
469 memset(&fl6, 0, sizeof(fl6)); 468 dst = inet6_csk_route_req(sk, &fl6, req, IPPROTO_DCCP);
470 fl6.flowi6_proto = IPPROTO_DCCP; 469 if (!dst)
471 fl6.daddr = ireq->ir_v6_rmt_addr;
472 final_p = fl6_update_dst(&fl6, np->opt, &final);
473 fl6.saddr = ireq->ir_v6_loc_addr;
474 fl6.flowi6_oif = sk->sk_bound_dev_if;
475 fl6.fl6_dport = ireq->ir_rmt_port;
476 fl6.fl6_sport = htons(ireq->ir_num);
477 security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
478
479 dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
480 if (IS_ERR(dst))
481 goto out; 470 goto out;
482 } 471 }
483 472