[INET6]: Generalise tcp_v6_hash_connect
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / dccp / ipv6.c
1 /*
2 * DCCP over IPv6
3 * Linux INET6 implementation
4 *
5 * Based on net/dccp6/ipv6.c
6 *
7 * Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15 #include <linux/config.h>
16 #include <linux/module.h>
17 #include <linux/random.h>
18 #include <linux/xfrm.h>
19
20 #include <net/addrconf.h>
21 #include <net/inet_common.h>
22 #include <net/inet_hashtables.h>
23 #include <net/inet6_connection_sock.h>
24 #include <net/inet6_hashtables.h>
25 #include <net/ip6_route.h>
26 #include <net/ipv6.h>
27 #include <net/protocol.h>
28 #include <net/transp_v6.h>
29 #include <net/xfrm.h>
30
31 #include "dccp.h"
32 #include "ipv6.h"
33
34 static void dccp_v6_ctl_send_reset(struct sk_buff *skb);
35 static void dccp_v6_reqsk_send_ack(struct sk_buff *skb,
36 struct request_sock *req);
37 static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb);
38
39 static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
40
41 static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
42 static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
43
44 static int dccp_v6_get_port(struct sock *sk, unsigned short snum)
45 {
46 return inet_csk_get_port(&dccp_hashinfo, sk, snum,
47 inet6_csk_bind_conflict);
48 }
49
50 static void dccp_v6_hash(struct sock *sk)
51 {
52 if (sk->sk_state != DCCP_CLOSED) {
53 if (inet_csk(sk)->icsk_af_ops == &dccp_ipv6_mapped) {
54 dccp_prot.hash(sk);
55 return;
56 }
57 local_bh_disable();
58 __inet6_hash(&dccp_hashinfo, sk);
59 local_bh_enable();
60 }
61 }
62
63 static inline u16 dccp_v6_check(struct dccp_hdr *dh, int len,
64 struct in6_addr *saddr,
65 struct in6_addr *daddr,
66 unsigned long base)
67 {
68 return csum_ipv6_magic(saddr, daddr, len, IPPROTO_DCCP, base);
69 }
70
71 static __u32 dccp_v6_init_sequence(struct sock *sk, struct sk_buff *skb)
72 {
73 const struct dccp_hdr *dh = dccp_hdr(skb);
74
75 if (skb->protocol == htons(ETH_P_IPV6))
76 return secure_tcpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32,
77 skb->nh.ipv6h->saddr.s6_addr32,
78 dh->dccph_dport,
79 dh->dccph_sport);
80 else
81 return secure_dccp_sequence_number(skb->nh.iph->daddr,
82 skb->nh.iph->saddr,
83 dh->dccph_dport,
84 dh->dccph_sport);
85 }
86
87 static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
88 int addr_len)
89 {
90 struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
91 struct inet_sock *inet = inet_sk(sk);
92 struct ipv6_pinfo *np = inet6_sk(sk);
93 struct dccp_sock *dp = dccp_sk(sk);
94 struct in6_addr *saddr = NULL, *final_p = NULL, final;
95 struct flowi fl;
96 struct dst_entry *dst;
97 int addr_type;
98 int err;
99
100 dp->dccps_role = DCCP_ROLE_CLIENT;
101
102 if (addr_len < SIN6_LEN_RFC2133)
103 return -EINVAL;
104
105 if (usin->sin6_family != AF_INET6)
106 return -EAFNOSUPPORT;
107
108 memset(&fl, 0, sizeof(fl));
109
110 if (np->sndflow) {
111 fl.fl6_flowlabel = usin->sin6_flowinfo & IPV6_FLOWINFO_MASK;
112 IP6_ECN_flow_init(fl.fl6_flowlabel);
113 if (fl.fl6_flowlabel & IPV6_FLOWLABEL_MASK) {
114 struct ip6_flowlabel *flowlabel;
115 flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
116 if (flowlabel == NULL)
117 return -EINVAL;
118 ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
119 fl6_sock_release(flowlabel);
120 }
121 }
122
123 /*
124 * connect() to INADDR_ANY means loopback (BSD'ism).
125 */
126
127 if (ipv6_addr_any(&usin->sin6_addr))
128 usin->sin6_addr.s6_addr[15] = 0x1;
129
130 addr_type = ipv6_addr_type(&usin->sin6_addr);
131
132 if(addr_type & IPV6_ADDR_MULTICAST)
133 return -ENETUNREACH;
134
135 if (addr_type & IPV6_ADDR_LINKLOCAL) {
136 if (addr_len >= sizeof(struct sockaddr_in6) &&
137 usin->sin6_scope_id) {
138 /* If interface is set while binding, indices
139 * must coincide.
140 */
141 if (sk->sk_bound_dev_if &&
142 sk->sk_bound_dev_if != usin->sin6_scope_id)
143 return -EINVAL;
144
145 sk->sk_bound_dev_if = usin->sin6_scope_id;
146 }
147
148 /* Connect to link-local address requires an interface */
149 if (!sk->sk_bound_dev_if)
150 return -EINVAL;
151 }
152
153 ipv6_addr_copy(&np->daddr, &usin->sin6_addr);
154 np->flow_label = fl.fl6_flowlabel;
155
156 /*
157 * DCCP over IPv4
158 */
159
160 if (addr_type == IPV6_ADDR_MAPPED) {
161 u32 exthdrlen = dp->dccps_ext_header_len;
162 struct sockaddr_in sin;
163
164 SOCK_DEBUG(sk, "connect: ipv4 mapped\n");
165
166 if (__ipv6_only_sock(sk))
167 return -ENETUNREACH;
168
169 sin.sin_family = AF_INET;
170 sin.sin_port = usin->sin6_port;
171 sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3];
172
173 inet_csk(sk)->icsk_af_ops = &dccp_ipv6_mapped;
174 sk->sk_backlog_rcv = dccp_v4_do_rcv;
175
176 err = dccp_v4_connect(sk, (struct sockaddr *)&sin, sizeof(sin));
177
178 if (err) {
179 dp->dccps_ext_header_len = exthdrlen;
180 inet_csk(sk)->icsk_af_ops = &dccp_ipv6_af_ops;
181 sk->sk_backlog_rcv = dccp_v6_do_rcv;
182 goto failure;
183 } else {
184 ipv6_addr_set(&np->saddr, 0, 0, htonl(0x0000FFFF),
185 inet->saddr);
186 ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000FFFF),
187 inet->rcv_saddr);
188 }
189
190 return err;
191 }
192
193 if (!ipv6_addr_any(&np->rcv_saddr))
194 saddr = &np->rcv_saddr;
195
196 fl.proto = IPPROTO_DCCP;
197 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
198 ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr);
199 fl.oif = sk->sk_bound_dev_if;
200 fl.fl_ip_dport = usin->sin6_port;
201 fl.fl_ip_sport = inet->sport;
202
203 if (np->opt && np->opt->srcrt) {
204 struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
205 ipv6_addr_copy(&final, &fl.fl6_dst);
206 ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
207 final_p = &final;
208 }
209
210 err = ip6_dst_lookup(sk, &dst, &fl);
211 if (err)
212 goto failure;
213 if (final_p)
214 ipv6_addr_copy(&fl.fl6_dst, final_p);
215
216 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0)
217 goto failure;
218
219 if (saddr == NULL) {
220 saddr = &fl.fl6_src;
221 ipv6_addr_copy(&np->rcv_saddr, saddr);
222 }
223
224 /* set the source address */
225 ipv6_addr_copy(&np->saddr, saddr);
226 inet->rcv_saddr = LOOPBACK4_IPV6;
227
228 ip6_dst_store(sk, dst, NULL);
229
230 dp->dccps_ext_header_len = 0;
231 if (np->opt)
232 dp->dccps_ext_header_len = np->opt->opt_flen + np->opt->opt_nflen;
233
234 inet->dport = usin->sin6_port;
235
236 dccp_set_state(sk, DCCP_REQUESTING);
237 err = inet6_hash_connect(&dccp_death_row, sk);
238 if (err)
239 goto late_failure;
240 /* FIXME */
241 #if 0
242 dp->dccps_gar = secure_dccp_v6_sequence_number(np->saddr.s6_addr32,
243 np->daddr.s6_addr32,
244 inet->sport,
245 inet->dport);
246 #endif
247 err = dccp_connect(sk);
248 if (err)
249 goto late_failure;
250
251 return 0;
252
253 late_failure:
254 dccp_set_state(sk, DCCP_CLOSED);
255 __sk_dst_reset(sk);
256 failure:
257 inet->dport = 0;
258 sk->sk_route_caps = 0;
259 return err;
260 }
261
262 static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
263 int type, int code, int offset, __u32 info)
264 {
265 struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data;
266 const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset);
267 struct ipv6_pinfo *np;
268 struct sock *sk;
269 int err;
270 __u64 seq;
271
272 sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport,
273 &hdr->saddr, dh->dccph_sport, skb->dev->ifindex);
274
275 if (sk == NULL) {
276 ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
277 return;
278 }
279
280 if (sk->sk_state == DCCP_TIME_WAIT) {
281 inet_twsk_put((struct inet_timewait_sock *)sk);
282 return;
283 }
284
285 bh_lock_sock(sk);
286 if (sock_owned_by_user(sk))
287 NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
288
289 if (sk->sk_state == DCCP_CLOSED)
290 goto out;
291
292 np = inet6_sk(sk);
293
294 if (type == ICMPV6_PKT_TOOBIG) {
295 struct dccp_sock *dp = dccp_sk(sk);
296 struct dst_entry *dst = NULL;
297
298 if (sock_owned_by_user(sk))
299 goto out;
300 if ((1 << sk->sk_state) & (DCCPF_LISTEN | DCCPF_CLOSED))
301 goto out;
302
303 /* icmp should have updated the destination cache entry */
304 dst = __sk_dst_check(sk, np->dst_cookie);
305
306 if (dst == NULL) {
307 struct inet_sock *inet = inet_sk(sk);
308 struct flowi fl;
309
310 /* BUGGG_FUTURE: Again, it is not clear how
311 to handle rthdr case. Ignore this complexity
312 for now.
313 */
314 memset(&fl, 0, sizeof(fl));
315 fl.proto = IPPROTO_DCCP;
316 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
317 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
318 fl.oif = sk->sk_bound_dev_if;
319 fl.fl_ip_dport = inet->dport;
320 fl.fl_ip_sport = inet->sport;
321
322 if ((err = ip6_dst_lookup(sk, &dst, &fl))) {
323 sk->sk_err_soft = -err;
324 goto out;
325 }
326
327 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) {
328 sk->sk_err_soft = -err;
329 goto out;
330 }
331
332 } else
333 dst_hold(dst);
334
335 if (dp->dccps_pmtu_cookie > dst_mtu(dst)) {
336 dccp_sync_mss(sk, dst_mtu(dst));
337 } /* else let the usual retransmit timer handle it */
338 dst_release(dst);
339 goto out;
340 }
341
342 icmpv6_err_convert(type, code, &err);
343
344 seq = DCCP_SKB_CB(skb)->dccpd_seq;
345 /* Might be for an request_sock */
346 switch (sk->sk_state) {
347 struct request_sock *req, **prev;
348 case DCCP_LISTEN:
349 if (sock_owned_by_user(sk))
350 goto out;
351
352 req = inet6_csk_search_req(sk, &prev, dh->dccph_dport,
353 &hdr->daddr, &hdr->saddr,
354 inet6_iif(skb));
355 if (!req)
356 goto out;
357
358 /* ICMPs are not backlogged, hence we cannot get
359 * an established socket here.
360 */
361 BUG_TRAP(req->sk == NULL);
362
363 if (seq != dccp_rsk(req)->dreq_iss) {
364 NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
365 goto out;
366 }
367
368 inet_csk_reqsk_queue_drop(sk, req, prev);
369 goto out;
370
371 case DCCP_REQUESTING:
372 case DCCP_RESPOND: /* Cannot happen.
373 It can, it SYNs are crossed. --ANK */
374 if (!sock_owned_by_user(sk)) {
375 DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS);
376 sk->sk_err = err;
377 /*
378 * Wake people up to see the error
379 * (see connect in sock.c)
380 */
381 sk->sk_error_report(sk);
382
383 dccp_done(sk);
384 } else
385 sk->sk_err_soft = err;
386 goto out;
387 }
388
389 if (!sock_owned_by_user(sk) && np->recverr) {
390 sk->sk_err = err;
391 sk->sk_error_report(sk);
392 } else
393 sk->sk_err_soft = err;
394
395 out:
396 bh_unlock_sock(sk);
397 sock_put(sk);
398 }
399
400
401 static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
402 struct dst_entry *dst)
403 {
404 struct inet6_request_sock *ireq6 = inet6_rsk(req);
405 struct ipv6_pinfo *np = inet6_sk(sk);
406 struct sk_buff *skb;
407 struct ipv6_txoptions *opt = NULL;
408 struct in6_addr *final_p = NULL, final;
409 struct flowi fl;
410 int err = -1;
411
412 memset(&fl, 0, sizeof(fl));
413 fl.proto = IPPROTO_DCCP;
414 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
415 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
416 fl.fl6_flowlabel = 0;
417 fl.oif = ireq6->iif;
418 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
419 fl.fl_ip_sport = inet_sk(sk)->sport;
420
421 if (dst == NULL) {
422 opt = np->opt;
423 if (opt == NULL &&
424 np->rxopt.bits.osrcrt == 2 &&
425 ireq6->pktopts) {
426 struct sk_buff *pktopts = ireq6->pktopts;
427 struct inet6_skb_parm *rxopt = IP6CB(pktopts);
428 if (rxopt->srcrt)
429 opt = ipv6_invert_rthdr(sk,
430 (struct ipv6_rt_hdr *)(pktopts->nh.raw +
431 rxopt->srcrt));
432 }
433
434 if (opt && opt->srcrt) {
435 struct rt0_hdr *rt0 = (struct rt0_hdr *)opt->srcrt;
436 ipv6_addr_copy(&final, &fl.fl6_dst);
437 ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
438 final_p = &final;
439 }
440
441 err = ip6_dst_lookup(sk, &dst, &fl);
442 if (err)
443 goto done;
444 if (final_p)
445 ipv6_addr_copy(&fl.fl6_dst, final_p);
446 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0)
447 goto done;
448 }
449
450 skb = dccp_make_response(sk, dst, req);
451 if (skb != NULL) {
452 struct dccp_hdr *dh = dccp_hdr(skb);
453 dh->dccph_checksum = dccp_v6_check(dh, skb->len,
454 &ireq6->loc_addr,
455 &ireq6->rmt_addr,
456 csum_partial((char *)dh,
457 skb->len,
458 skb->csum));
459 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
460 err = ip6_xmit(sk, skb, &fl, opt, 0);
461 if (err == NET_XMIT_CN)
462 err = 0;
463 }
464
465 done:
466 if (opt && opt != np->opt)
467 sock_kfree_s(sk, opt, opt->tot_len);
468 return err;
469 }
470
471 static void dccp_v6_reqsk_destructor(struct request_sock *req)
472 {
473 if (inet6_rsk(req)->pktopts != NULL)
474 kfree_skb(inet6_rsk(req)->pktopts);
475 }
476
477 static struct request_sock_ops dccp6_request_sock_ops = {
478 .family = AF_INET6,
479 .obj_size = sizeof(struct dccp6_request_sock),
480 .rtx_syn_ack = dccp_v6_send_response,
481 .send_ack = dccp_v6_reqsk_send_ack,
482 .destructor = dccp_v6_reqsk_destructor,
483 .send_reset = dccp_v6_ctl_send_reset,
484 };
485
486 static struct timewait_sock_ops dccp6_timewait_sock_ops = {
487 .twsk_obj_size = sizeof(struct dccp6_timewait_sock),
488 };
489
490 static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb)
491 {
492 struct ipv6_pinfo *np = inet6_sk(sk);
493 struct dccp_hdr *dh = dccp_hdr(skb);
494
495 dh->dccph_checksum = csum_ipv6_magic(&np->saddr, &np->daddr,
496 len, IPPROTO_DCCP,
497 csum_partial((char *)dh,
498 dh->dccph_doff << 2,
499 skb->csum));
500 }
501
502 static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb)
503 {
504 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
505 const int dccp_hdr_reset_len = sizeof(struct dccp_hdr) +
506 sizeof(struct dccp_hdr_ext) +
507 sizeof(struct dccp_hdr_reset);
508 struct sk_buff *skb;
509 struct flowi fl;
510 u64 seqno;
511
512 if (rxdh->dccph_type == DCCP_PKT_RESET)
513 return;
514
515 if (!ipv6_unicast_destination(rxskb))
516 return;
517
518 /*
519 * We need to grab some memory, and put together an RST,
520 * and then put it into the queue to be sent.
521 */
522
523 skb = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) +
524 dccp_hdr_reset_len, GFP_ATOMIC);
525 if (skb == NULL)
526 return;
527
528 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr) +
529 dccp_hdr_reset_len);
530
531 skb->h.raw = skb_push(skb, dccp_hdr_reset_len);
532 dh = dccp_hdr(skb);
533 memset(dh, 0, dccp_hdr_reset_len);
534
535 /* Swap the send and the receive. */
536 dh->dccph_type = DCCP_PKT_RESET;
537 dh->dccph_sport = rxdh->dccph_dport;
538 dh->dccph_dport = rxdh->dccph_sport;
539 dh->dccph_doff = dccp_hdr_reset_len / 4;
540 dh->dccph_x = 1;
541 dccp_hdr_reset(skb)->dccph_reset_code =
542 DCCP_SKB_CB(rxskb)->dccpd_reset_code;
543
544 /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */
545 seqno = 0;
546 if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
547 dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1);
548
549 dccp_hdr_set_seq(dh, seqno);
550 dccp_hdr_set_ack(dccp_hdr_ack_bits(skb),
551 DCCP_SKB_CB(rxskb)->dccpd_seq);
552
553 memset(&fl, 0, sizeof(fl));
554 ipv6_addr_copy(&fl.fl6_dst, &rxskb->nh.ipv6h->saddr);
555 ipv6_addr_copy(&fl.fl6_src, &rxskb->nh.ipv6h->daddr);
556 dh->dccph_checksum = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst,
557 sizeof(*dh), IPPROTO_DCCP,
558 skb->csum);
559 fl.proto = IPPROTO_DCCP;
560 fl.oif = inet6_iif(rxskb);
561 fl.fl_ip_dport = dh->dccph_dport;
562 fl.fl_ip_sport = dh->dccph_sport;
563
564 /* sk = NULL, but it is safe for now. RST socket required. */
565 if (!ip6_dst_lookup(NULL, &skb->dst, &fl)) {
566 if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) {
567 ip6_xmit(NULL, skb, &fl, NULL, 0);
568 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
569 DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS);
570 return;
571 }
572 }
573
574 kfree_skb(skb);
575 }
576
577 static void dccp_v6_ctl_send_ack(struct sk_buff *rxskb)
578 {
579 struct flowi fl;
580 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
581 const int dccp_hdr_ack_len = sizeof(struct dccp_hdr) +
582 sizeof(struct dccp_hdr_ext) +
583 sizeof(struct dccp_hdr_ack_bits);
584 struct sk_buff *skb;
585
586 skb = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) +
587 dccp_hdr_ack_len, GFP_ATOMIC);
588 if (skb == NULL)
589 return;
590
591 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr) +
592 dccp_hdr_ack_len);
593
594 skb->h.raw = skb_push(skb, dccp_hdr_ack_len);
595 dh = dccp_hdr(skb);
596 memset(dh, 0, dccp_hdr_ack_len);
597
598 /* Build DCCP header and checksum it. */
599 dh->dccph_type = DCCP_PKT_ACK;
600 dh->dccph_sport = rxdh->dccph_dport;
601 dh->dccph_dport = rxdh->dccph_sport;
602 dh->dccph_doff = dccp_hdr_ack_len / 4;
603 dh->dccph_x = 1;
604
605 dccp_hdr_set_seq(dh, DCCP_SKB_CB(rxskb)->dccpd_ack_seq);
606 dccp_hdr_set_ack(dccp_hdr_ack_bits(skb),
607 DCCP_SKB_CB(rxskb)->dccpd_seq);
608
609 memset(&fl, 0, sizeof(fl));
610 ipv6_addr_copy(&fl.fl6_dst, &rxskb->nh.ipv6h->saddr);
611 ipv6_addr_copy(&fl.fl6_src, &rxskb->nh.ipv6h->daddr);
612
613 /* FIXME: calculate checksum, IPv4 also should... */
614
615 fl.proto = IPPROTO_DCCP;
616 fl.oif = inet6_iif(rxskb);
617 fl.fl_ip_dport = dh->dccph_dport;
618 fl.fl_ip_sport = dh->dccph_sport;
619
620 if (!ip6_dst_lookup(NULL, &skb->dst, &fl)) {
621 if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) {
622 ip6_xmit(NULL, skb, &fl, NULL, 0);
623 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
624 return;
625 }
626 }
627
628 kfree_skb(skb);
629 }
630
631 static void dccp_v6_reqsk_send_ack(struct sk_buff *skb,
632 struct request_sock *req)
633 {
634 dccp_v6_ctl_send_ack(skb);
635 }
636
637 static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
638 {
639 const struct dccp_hdr *dh = dccp_hdr(skb);
640 const struct ipv6hdr *iph = skb->nh.ipv6h;
641 struct sock *nsk;
642 struct request_sock **prev;
643 /* Find possible connection requests. */
644 struct request_sock *req = inet6_csk_search_req(sk, &prev,
645 dh->dccph_sport,
646 &iph->saddr,
647 &iph->daddr,
648 inet6_iif(skb));
649 if (req != NULL)
650 return dccp_check_req(sk, skb, req, prev);
651
652 nsk = __inet6_lookup_established(&dccp_hashinfo,
653 &iph->saddr, dh->dccph_sport,
654 &iph->daddr, ntohs(dh->dccph_dport),
655 inet6_iif(skb));
656
657 if (nsk != NULL) {
658 if (nsk->sk_state != DCCP_TIME_WAIT) {
659 bh_lock_sock(nsk);
660 return nsk;
661 }
662 inet_twsk_put((struct inet_timewait_sock *)nsk);
663 return NULL;
664 }
665
666 return sk;
667 }
668
669 static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
670 {
671 struct inet_request_sock *ireq;
672 struct dccp_sock dp;
673 struct request_sock *req;
674 struct dccp_request_sock *dreq;
675 struct inet6_request_sock *ireq6;
676 struct ipv6_pinfo *np = inet6_sk(sk);
677 const __u32 service = dccp_hdr_request(skb)->dccph_req_service;
678 struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb);
679 __u8 reset_code = DCCP_RESET_CODE_TOO_BUSY;
680
681 if (skb->protocol == htons(ETH_P_IP))
682 return dccp_v4_conn_request(sk, skb);
683
684 if (!ipv6_unicast_destination(skb))
685 goto drop;
686
687 if (dccp_bad_service_code(sk, service)) {
688 reset_code = DCCP_RESET_CODE_BAD_SERVICE_CODE;
689 goto drop;
690 }
691 /*
692 * There are no SYN attacks on IPv6, yet...
693 */
694 if (inet_csk_reqsk_queue_is_full(sk))
695 goto drop;
696
697 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
698 goto drop;
699
700 req = inet6_reqsk_alloc(sk->sk_prot->rsk_prot);
701 if (req == NULL)
702 goto drop;
703
704 /* FIXME: process options */
705
706 dccp_openreq_init(req, &dp, skb);
707
708 ireq6 = inet6_rsk(req);
709 ireq = inet_rsk(req);
710 ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
711 ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
712 req->rcv_wnd = 100; /* Fake, option parsing will get the
713 right value */
714 ireq6->pktopts = NULL;
715
716 if (ipv6_opt_accepted(sk, skb) ||
717 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
718 np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
719 atomic_inc(&skb->users);
720 ireq6->pktopts = skb;
721 }
722 ireq6->iif = sk->sk_bound_dev_if;
723
724 /* So that link locals have meaning */
725 if (!sk->sk_bound_dev_if &&
726 ipv6_addr_type(&ireq6->rmt_addr) & IPV6_ADDR_LINKLOCAL)
727 ireq6->iif = inet6_iif(skb);
728
729 /*
730 * Step 3: Process LISTEN state
731 *
732 * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init Cookie
733 *
734 * In fact we defer setting S.GSR, S.SWL, S.SWH to
735 * dccp_create_openreq_child.
736 */
737 dreq = dccp_rsk(req);
738 dreq->dreq_isr = dcb->dccpd_seq;
739 dreq->dreq_iss = dccp_v6_init_sequence(sk, skb);
740 dreq->dreq_service = service;
741
742 if (dccp_v6_send_response(sk, req, NULL))
743 goto drop_and_free;
744
745 inet6_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT);
746 return 0;
747
748 drop_and_free:
749 reqsk_free(req);
750 drop:
751 DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS);
752 dcb->dccpd_reset_code = reset_code;
753 return -1;
754 }
755
756 static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
757 struct sk_buff *skb,
758 struct request_sock *req,
759 struct dst_entry *dst)
760 {
761 struct inet6_request_sock *ireq6 = inet6_rsk(req);
762 struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
763 struct inet_sock *newinet;
764 struct dccp_sock *newdp;
765 struct dccp6_sock *newdp6;
766 struct sock *newsk;
767 struct ipv6_txoptions *opt;
768
769 if (skb->protocol == htons(ETH_P_IP)) {
770 /*
771 * v6 mapped
772 */
773
774 newsk = dccp_v4_request_recv_sock(sk, skb, req, dst);
775 if (newsk == NULL)
776 return NULL;
777
778 newdp6 = (struct dccp6_sock *)newsk;
779 newdp = dccp_sk(newsk);
780 newinet = inet_sk(newsk);
781 newinet->pinet6 = &newdp6->inet6;
782 newnp = inet6_sk(newsk);
783
784 memcpy(newnp, np, sizeof(struct ipv6_pinfo));
785
786 ipv6_addr_set(&newnp->daddr, 0, 0, htonl(0x0000FFFF),
787 newinet->daddr);
788
789 ipv6_addr_set(&newnp->saddr, 0, 0, htonl(0x0000FFFF),
790 newinet->saddr);
791
792 ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr);
793
794 inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped;
795 newsk->sk_backlog_rcv = dccp_v4_do_rcv;
796 newnp->pktoptions = NULL;
797 newnp->opt = NULL;
798 newnp->mcast_oif = inet6_iif(skb);
799 newnp->mcast_hops = skb->nh.ipv6h->hop_limit;
800
801 /*
802 * No need to charge this sock to the relevant IPv6 refcnt debug socks count
803 * here, dccp_create_openreq_child now does this for us, see the comment in
804 * that function for the gory details. -acme
805 */
806
807 /* It is tricky place. Until this moment IPv4 tcp
808 worked with IPv6 icsk.icsk_af_ops.
809 Sync it now.
810 */
811 dccp_sync_mss(newsk, newdp->dccps_pmtu_cookie);
812
813 return newsk;
814 }
815
816 opt = np->opt;
817
818 if (sk_acceptq_is_full(sk))
819 goto out_overflow;
820
821 if (np->rxopt.bits.osrcrt == 2 &&
822 opt == NULL && ireq6->pktopts) {
823 struct inet6_skb_parm *rxopt = IP6CB(ireq6->pktopts);
824 if (rxopt->srcrt)
825 opt = ipv6_invert_rthdr(sk,
826 (struct ipv6_rt_hdr *)(ireq6->pktopts->nh.raw +
827 rxopt->srcrt));
828 }
829
830 if (dst == NULL) {
831 struct in6_addr *final_p = NULL, final;
832 struct flowi fl;
833
834 memset(&fl, 0, sizeof(fl));
835 fl.proto = IPPROTO_DCCP;
836 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
837 if (opt && opt->srcrt) {
838 struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt;
839 ipv6_addr_copy(&final, &fl.fl6_dst);
840 ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
841 final_p = &final;
842 }
843 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
844 fl.oif = sk->sk_bound_dev_if;
845 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
846 fl.fl_ip_sport = inet_sk(sk)->sport;
847
848 if (ip6_dst_lookup(sk, &dst, &fl))
849 goto out;
850
851 if (final_p)
852 ipv6_addr_copy(&fl.fl6_dst, final_p);
853
854 if ((xfrm_lookup(&dst, &fl, sk, 0)) < 0)
855 goto out;
856 }
857
858 newsk = dccp_create_openreq_child(sk, req, skb);
859 if (newsk == NULL)
860 goto out;
861
862 /*
863 * No need to charge this sock to the relevant IPv6 refcnt debug socks
864 * count here, dccp_create_openreq_child now does this for us, see the
865 * comment in that function for the gory details. -acme
866 */
867
868 ip6_dst_store(newsk, dst, NULL);
869 newsk->sk_route_caps = dst->dev->features &
870 ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
871
872 newdp6 = (struct dccp6_sock *)newsk;
873 newinet = inet_sk(newsk);
874 newinet->pinet6 = &newdp6->inet6;
875 newdp = dccp_sk(newsk);
876 newnp = inet6_sk(newsk);
877
878 memcpy(newnp, np, sizeof(struct ipv6_pinfo));
879
880 ipv6_addr_copy(&newnp->daddr, &ireq6->rmt_addr);
881 ipv6_addr_copy(&newnp->saddr, &ireq6->loc_addr);
882 ipv6_addr_copy(&newnp->rcv_saddr, &ireq6->loc_addr);
883 newsk->sk_bound_dev_if = ireq6->iif;
884
885 /* Now IPv6 options...
886
887 First: no IPv4 options.
888 */
889 newinet->opt = NULL;
890
891 /* Clone RX bits */
892 newnp->rxopt.all = np->rxopt.all;
893
894 /* Clone pktoptions received with SYN */
895 newnp->pktoptions = NULL;
896 if (ireq6->pktopts != NULL) {
897 newnp->pktoptions = skb_clone(ireq6->pktopts, GFP_ATOMIC);
898 kfree_skb(ireq6->pktopts);
899 ireq6->pktopts = NULL;
900 if (newnp->pktoptions)
901 skb_set_owner_r(newnp->pktoptions, newsk);
902 }
903 newnp->opt = NULL;
904 newnp->mcast_oif = inet6_iif(skb);
905 newnp->mcast_hops = skb->nh.ipv6h->hop_limit;
906
907 /* Clone native IPv6 options from listening socket (if any)
908
909 Yes, keeping reference count would be much more clever,
910 but we make one more one thing there: reattach optmem
911 to newsk.
912 */
913 if (opt) {
914 newnp->opt = ipv6_dup_options(newsk, opt);
915 if (opt != np->opt)
916 sock_kfree_s(sk, opt, opt->tot_len);
917 }
918
919 newdp->dccps_ext_header_len = 0;
920 if (newnp->opt)
921 newdp->dccps_ext_header_len = newnp->opt->opt_nflen +
922 newnp->opt->opt_flen;
923
924 dccp_sync_mss(newsk, dst_mtu(dst));
925
926 newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6;
927
928 __inet6_hash(&dccp_hashinfo, newsk);
929 inet_inherit_port(&dccp_hashinfo, sk, newsk);
930
931 return newsk;
932
933 out_overflow:
934 NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
935 out:
936 NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
937 if (opt && opt != np->opt)
938 sock_kfree_s(sk, opt, opt->tot_len);
939 dst_release(dst);
940 return NULL;
941 }
942
943 /* The socket must have it's spinlock held when we get
944 * here.
945 *
946 * We have a potential double-lock case here, so even when
947 * doing backlog processing we use the BH locking scheme.
948 * This is because we cannot sleep with the original spinlock
949 * held.
950 */
951 static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
952 {
953 struct ipv6_pinfo *np = inet6_sk(sk);
954 struct sk_buff *opt_skb = NULL;
955
956 /* Imagine: socket is IPv6. IPv4 packet arrives,
957 goes to IPv4 receive handler and backlogged.
958 From backlog it always goes here. Kerboom...
959 Fortunately, dccp_rcv_established and rcv_established
960 handle them correctly, but it is not case with
961 dccp_v6_hnd_req and dccp_v6_ctl_send_reset(). --ANK
962 */
963
964 if (skb->protocol == htons(ETH_P_IP))
965 return dccp_v4_do_rcv(sk, skb);
966
967 if (sk_filter(sk, skb, 0))
968 goto discard;
969
970 /*
971 * socket locking is here for SMP purposes as backlog rcv
972 * is currently called with bh processing disabled.
973 */
974
975 /* Do Stevens' IPV6_PKTOPTIONS.
976
977 Yes, guys, it is the only place in our code, where we
978 may make it not affecting IPv4.
979 The rest of code is protocol independent,
980 and I do not like idea to uglify IPv4.
981
982 Actually, all the idea behind IPV6_PKTOPTIONS
983 looks not very well thought. For now we latch
984 options, received in the last packet, enqueued
985 by tcp. Feel free to propose better solution.
986 --ANK (980728)
987 */
988 if (np->rxopt.all)
989 opt_skb = skb_clone(skb, GFP_ATOMIC);
990
991 if (sk->sk_state == DCCP_OPEN) { /* Fast path */
992 if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len))
993 goto reset;
994 return 0;
995 }
996
997 if (sk->sk_state == DCCP_LISTEN) {
998 struct sock *nsk = dccp_v6_hnd_req(sk, skb);
999 if (!nsk)
1000 goto discard;
1001
1002 /*
1003 * Queue it on the new socket if the new socket is active,
1004 * otherwise we just shortcircuit this and continue with
1005 * the new socket..
1006 */
1007 if(nsk != sk) {
1008 if (dccp_child_process(sk, nsk, skb))
1009 goto reset;
1010 if (opt_skb)
1011 __kfree_skb(opt_skb);
1012 return 0;
1013 }
1014 }
1015
1016 if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len))
1017 goto reset;
1018 return 0;
1019
1020 reset:
1021 dccp_v6_ctl_send_reset(skb);
1022 discard:
1023 if (opt_skb)
1024 __kfree_skb(opt_skb);
1025 kfree_skb(skb);
1026 return 0;
1027 }
1028
1029 static int dccp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
1030 {
1031 const struct dccp_hdr *dh;
1032 struct sk_buff *skb = *pskb;
1033 struct sock *sk;
1034 int rc;
1035
1036 /* Step 1: Check header basics: */
1037
1038 if (dccp_invalid_packet(skb))
1039 goto discard_it;
1040
1041 dh = dccp_hdr(skb);
1042
1043 DCCP_SKB_CB(skb)->dccpd_seq = dccp_hdr_seq(skb);
1044 DCCP_SKB_CB(skb)->dccpd_type = dh->dccph_type;
1045
1046 if (dccp_packet_without_ack(skb))
1047 DCCP_SKB_CB(skb)->dccpd_ack_seq = DCCP_PKT_WITHOUT_ACK_SEQ;
1048 else
1049 DCCP_SKB_CB(skb)->dccpd_ack_seq = dccp_hdr_ack_seq(skb);
1050
1051 /* Step 2:
1052 * Look up flow ID in table and get corresponding socket */
1053 sk = __inet6_lookup(&dccp_hashinfo, &skb->nh.ipv6h->saddr,
1054 dh->dccph_sport,
1055 &skb->nh.ipv6h->daddr, ntohs(dh->dccph_dport),
1056 inet6_iif(skb));
1057 /*
1058 * Step 2:
1059 * If no socket ...
1060 * Generate Reset(No Connection) unless P.type == Reset
1061 * Drop packet and return
1062 */
1063 if (sk == NULL)
1064 goto no_dccp_socket;
1065
1066 /*
1067 * Step 2:
1068 * ... or S.state == TIMEWAIT,
1069 * Generate Reset(No Connection) unless P.type == Reset
1070 * Drop packet and return
1071 */
1072
1073 if (sk->sk_state == DCCP_TIME_WAIT)
1074 goto do_time_wait;
1075
1076 if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
1077 goto discard_and_relse;
1078
1079 if (sk_filter(sk, skb, 0))
1080 goto discard_and_relse;
1081
1082 skb->dev = NULL;
1083
1084 bh_lock_sock(sk);
1085 rc = 0;
1086 if (!sock_owned_by_user(sk))
1087 rc = dccp_v6_do_rcv(sk, skb);
1088 else
1089 sk_add_backlog(sk, skb);
1090 bh_unlock_sock(sk);
1091
1092 sock_put(sk);
1093 return rc ? -1 : 0;
1094
1095 no_dccp_socket:
1096 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
1097 goto discard_it;
1098 /*
1099 * Step 2:
1100 * Generate Reset(No Connection) unless P.type == Reset
1101 * Drop packet and return
1102 */
1103 if (dh->dccph_type != DCCP_PKT_RESET) {
1104 DCCP_SKB_CB(skb)->dccpd_reset_code =
1105 DCCP_RESET_CODE_NO_CONNECTION;
1106 dccp_v6_ctl_send_reset(skb);
1107 }
1108 discard_it:
1109
1110 /*
1111 * Discard frame
1112 */
1113
1114 kfree_skb(skb);
1115 return 0;
1116
1117 discard_and_relse:
1118 sock_put(sk);
1119 goto discard_it;
1120
1121 do_time_wait:
1122 inet_twsk_put((struct inet_timewait_sock *)sk);
1123 goto no_dccp_socket;
1124 }
1125
1126 static struct inet_connection_sock_af_ops dccp_ipv6_af_ops = {
1127 .queue_xmit = inet6_csk_xmit,
1128 .send_check = dccp_v6_send_check,
1129 .rebuild_header = inet6_sk_rebuild_header,
1130 .conn_request = dccp_v6_conn_request,
1131 .syn_recv_sock = dccp_v6_request_recv_sock,
1132 .net_header_len = sizeof(struct ipv6hdr),
1133 .setsockopt = ipv6_setsockopt,
1134 .getsockopt = ipv6_getsockopt,
1135 .addr2sockaddr = inet6_csk_addr2sockaddr,
1136 .sockaddr_len = sizeof(struct sockaddr_in6)
1137 };
1138
1139 /*
1140 * DCCP over IPv4 via INET6 API
1141 */
1142 static struct inet_connection_sock_af_ops dccp_ipv6_mapped = {
1143 .queue_xmit = ip_queue_xmit,
1144 .send_check = dccp_v4_send_check,
1145 .rebuild_header = inet_sk_rebuild_header,
1146 .conn_request = dccp_v6_conn_request,
1147 .syn_recv_sock = dccp_v6_request_recv_sock,
1148 .net_header_len = sizeof(struct iphdr),
1149 .setsockopt = ipv6_setsockopt,
1150 .getsockopt = ipv6_getsockopt,
1151 .addr2sockaddr = inet6_csk_addr2sockaddr,
1152 .sockaddr_len = sizeof(struct sockaddr_in6)
1153 };
1154
1155 /* NOTE: A lot of things set to zero explicitly by call to
1156 * sk_alloc() so need not be done here.
1157 */
1158 static int dccp_v6_init_sock(struct sock *sk)
1159 {
1160 int err = dccp_v4_init_sock(sk);
1161
1162 if (err == 0)
1163 inet_csk(sk)->icsk_af_ops = &dccp_ipv6_af_ops;
1164
1165 return err;
1166 }
1167
1168 static int dccp_v6_destroy_sock(struct sock *sk)
1169 {
1170 dccp_v4_destroy_sock(sk);
1171 return inet6_destroy_sock(sk);
1172 }
1173
1174 static struct proto dccp_v6_prot = {
1175 .name = "DCCPv6",
1176 .owner = THIS_MODULE,
1177 .close = dccp_close,
1178 .connect = dccp_v6_connect,
1179 .disconnect = dccp_disconnect,
1180 .ioctl = dccp_ioctl,
1181 .init = dccp_v6_init_sock,
1182 .setsockopt = dccp_setsockopt,
1183 .getsockopt = dccp_getsockopt,
1184 .sendmsg = dccp_sendmsg,
1185 .recvmsg = dccp_recvmsg,
1186 .backlog_rcv = dccp_v6_do_rcv,
1187 .hash = dccp_v6_hash,
1188 .unhash = dccp_unhash,
1189 .accept = inet_csk_accept,
1190 .get_port = dccp_v6_get_port,
1191 .shutdown = dccp_shutdown,
1192 .destroy = dccp_v6_destroy_sock,
1193 .orphan_count = &dccp_orphan_count,
1194 .max_header = MAX_DCCP_HEADER,
1195 .obj_size = sizeof(struct dccp6_sock),
1196 .rsk_prot = &dccp6_request_sock_ops,
1197 .twsk_prot = &dccp6_timewait_sock_ops,
1198 };
1199
1200 static struct inet6_protocol dccp_v6_protocol = {
1201 .handler = dccp_v6_rcv,
1202 .err_handler = dccp_v6_err,
1203 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
1204 };
1205
1206 static struct proto_ops inet6_dccp_ops = {
1207 .family = PF_INET6,
1208 .owner = THIS_MODULE,
1209 .release = inet6_release,
1210 .bind = inet6_bind,
1211 .connect = inet_stream_connect,
1212 .socketpair = sock_no_socketpair,
1213 .accept = inet_accept,
1214 .getname = inet6_getname,
1215 .poll = dccp_poll,
1216 .ioctl = inet6_ioctl,
1217 .listen = inet_dccp_listen,
1218 .shutdown = inet_shutdown,
1219 .setsockopt = sock_common_setsockopt,
1220 .getsockopt = sock_common_getsockopt,
1221 .sendmsg = inet_sendmsg,
1222 .recvmsg = sock_common_recvmsg,
1223 .mmap = sock_no_mmap,
1224 .sendpage = sock_no_sendpage,
1225 };
1226
1227 static struct inet_protosw dccp_v6_protosw = {
1228 .type = SOCK_DCCP,
1229 .protocol = IPPROTO_DCCP,
1230 .prot = &dccp_v6_prot,
1231 .ops = &inet6_dccp_ops,
1232 .capability = -1,
1233 };
1234
1235 static int __init dccp_v6_init(void)
1236 {
1237 int err = proto_register(&dccp_v6_prot, 1);
1238
1239 if (err != 0)
1240 goto out;
1241
1242 err = inet6_add_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
1243 if (err != 0)
1244 goto out_unregister_proto;
1245
1246 inet6_register_protosw(&dccp_v6_protosw);
1247 out:
1248 return err;
1249 out_unregister_proto:
1250 proto_unregister(&dccp_v6_prot);
1251 goto out;
1252 }
1253
1254 static void __exit dccp_v6_exit(void)
1255 {
1256 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
1257 inet6_unregister_protosw(&dccp_v6_protosw);
1258 proto_unregister(&dccp_v6_prot);
1259 }
1260
1261 module_init(dccp_v6_init);
1262 module_exit(dccp_v6_exit);
1263
1264 /*
1265 * __stringify doesn't likes enums, so use SOCK_DCCP (6) and IPPROTO_DCCP (33)
1266 * values directly, Also cover the case where the protocol is not specified,
1267 * i.e. net-pf-PF_INET6-proto-0-type-SOCK_DCCP
1268 */
1269 MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-33-type-6");
1270 MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-0-type-6");
1271 MODULE_LICENSE("GPL");
1272 MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
1273 MODULE_DESCRIPTION("DCCPv6 - Datagram Congestion Controlled Protocol");