aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index dee085301576..718509dcb24d 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -37,8 +37,6 @@
37static struct socket *dccp_v6_ctl_socket; 37static struct socket *dccp_v6_ctl_socket;
38 38
39static void dccp_v6_ctl_send_reset(struct sk_buff *skb); 39static void dccp_v6_ctl_send_reset(struct sk_buff *skb);
40static void dccp_v6_reqsk_send_ack(struct sk_buff *skb,
41 struct request_sock *req);
42static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb); 40static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb);
43 41
44static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); 42static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
@@ -493,7 +491,7 @@ static struct request_sock_ops dccp6_request_sock_ops = {
493 .family = AF_INET6, 491 .family = AF_INET6,
494 .obj_size = sizeof(struct dccp6_request_sock), 492 .obj_size = sizeof(struct dccp6_request_sock),
495 .rtx_syn_ack = dccp_v6_send_response, 493 .rtx_syn_ack = dccp_v6_send_response,
496 .send_ack = dccp_v6_reqsk_send_ack, 494 .send_ack = dccp_reqsk_send_ack,
497 .destructor = dccp_v6_reqsk_destructor, 495 .destructor = dccp_v6_reqsk_destructor,
498 .send_reset = dccp_v6_ctl_send_reset, 496 .send_reset = dccp_v6_ctl_send_reset,
499}; 497};
@@ -582,59 +580,6 @@ static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb)
582 kfree_skb(skb); 580 kfree_skb(skb);
583} 581}
584 582
585static void dccp_v6_reqsk_send_ack(struct sk_buff *rxskb,
586 struct request_sock *req)
587{
588 struct flowi fl;
589 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
590 const u32 dccp_hdr_ack_len = sizeof(struct dccp_hdr) +
591 sizeof(struct dccp_hdr_ext) +
592 sizeof(struct dccp_hdr_ack_bits);
593 struct sk_buff *skb;
594
595 skb = alloc_skb(dccp_v6_ctl_socket->sk->sk_prot->max_header,
596 GFP_ATOMIC);
597 if (skb == NULL)
598 return;
599
600 skb_reserve(skb, dccp_v6_ctl_socket->sk->sk_prot->max_header);
601
602 dh = dccp_zeroed_hdr(skb, dccp_hdr_ack_len);
603
604 /* Build DCCP header and checksum it. */
605 dh->dccph_type = DCCP_PKT_ACK;
606 dh->dccph_sport = rxdh->dccph_dport;
607 dh->dccph_dport = rxdh->dccph_sport;
608 dh->dccph_doff = dccp_hdr_ack_len / 4;
609 dh->dccph_x = 1;
610
611 dccp_hdr_set_seq(dh, DCCP_SKB_CB(rxskb)->dccpd_ack_seq);
612 dccp_hdr_set_ack(dccp_hdr_ack_bits(skb),
613 DCCP_SKB_CB(rxskb)->dccpd_seq);
614
615 memset(&fl, 0, sizeof(fl));
616 ipv6_addr_copy(&fl.fl6_dst, &rxskb->nh.ipv6h->saddr);
617 ipv6_addr_copy(&fl.fl6_src, &rxskb->nh.ipv6h->daddr);
618
619 /* FIXME: calculate checksum, IPv4 also should... */
620
621 fl.proto = IPPROTO_DCCP;
622 fl.oif = inet6_iif(rxskb);
623 fl.fl_ip_dport = dh->dccph_dport;
624 fl.fl_ip_sport = dh->dccph_sport;
625 security_req_classify_flow(req, &fl);
626
627 if (!ip6_dst_lookup(NULL, &skb->dst, &fl)) {
628 if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) {
629 ip6_xmit(dccp_v6_ctl_socket->sk, skb, &fl, NULL, 0);
630 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
631 return;
632 }
633 }
634
635 kfree_skb(skb);
636}
637
638static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) 583static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
639{ 584{
640 const struct dccp_hdr *dh = dccp_hdr(skb); 585 const struct dccp_hdr *dh = dccp_hdr(skb);