27 #include <linux/module.h>
28 #include <linux/errno.h>
29 #include <linux/types.h>
30 #include <linux/socket.h>
32 #include <linux/net.h>
35 #include <linux/in6.h>
36 #include <linux/netdevice.h>
41 #include <linux/slab.h>
43 #include <linux/ipv6.h>
44 #include <linux/icmpv6.h>
45 #include <linux/random.h>
67 #include <asm/uaccess.h>
80 static void __tcp_v6_send_check(
struct sk_buff *
skb,
86 #ifdef CONFIG_TCP_MD5SIG
104 inet_sk(sk)->rx_dst_ifindex = skb->
skb_iif;
106 inet6_sk(sk)->rx_dst_cookie = rt->
rt6i_node->fn_sernum;
109 static void tcp_v6_hash(
struct sock *sk)
112 if (inet_csk(sk)->icsk_af_ops == &ipv6_mapped) {
130 static __u32 tcp_v6_init_sequence(
const struct sk_buff *skb)
133 ipv6_hdr(skb)->
saddr.s6_addr32,
159 memset(&fl6, 0,
sizeof(fl6));
167 if (flowlabel ==
NULL)
170 fl6_sock_release(flowlabel);
181 addr_type = ipv6_addr_type(&usin->
sin6_addr);
192 if (sk->sk_bound_dev_if &&
200 if (!sk->sk_bound_dev_if)
204 if (tp->
rx_opt.ts_recent_stamp &&
207 tp->
rx_opt.ts_recent_stamp = 0;
229 sin.sin_addr.s_addr = usin->
sin6_addr.s6_addr32[3];
233 #ifdef CONFIG_TCP_MD5SIG
234 tp->af_specific = &tcp_sock_ipv6_mapped_specific;
243 #ifdef CONFIG_TCP_MD5SIG
244 tp->af_specific = &tcp_sock_ipv6_specific;
249 ipv6_addr_set_v4mapped(inet->inet_rcv_saddr,
260 fl6.daddr = np->
daddr;
261 fl6.saddr = saddr ? *saddr : np->
saddr;
262 fl6.flowi6_oif = sk->sk_bound_dev_if;
269 security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
287 __ip6_dst_store(sk, dst,
NULL,
NULL);
291 !tp->
rx_opt.ts_recent_stamp &&
292 ipv6_addr_equal(&rt->rt6i_dst.addr, &np->
daddr))
330 static void tcp_v6_mtu_reduced(
struct sock *sk)
341 if (inet_csk(sk)->icsk_pmtu_cookie > dst_mtu(dst)) {
380 if (ipv6_hdr(skb)->
hop_limit < inet6_sk(sk)->min_hopcount) {
399 dst->
ops->redirect(dst, sk, skb);
405 tcp_v6_mtu_reduced(sk);
415 switch (sk->sk_state) {
422 &hdr->
saddr, inet6_iif(skb));
431 if (seq != tcp_rsk(req)->snt_isn) {
436 inet_csk_reqsk_queue_drop(sk, req, prev);
464 static int tcp_v6_send_synack(
struct sock *sk,
struct dst_entry *dst,
485 skb_set_queue_mapping(skb, queue_mapping);
500 return tcp_v6_send_synack(sk,
NULL, &fl6, req, rvp, 0);
503 static void tcp_v6_reqsk_destructor(
struct request_sock *req)
508 #ifdef CONFIG_TCP_MD5SIG
516 struct sock *addr_sk)
518 return tcp_v6_md5_do_lookup(sk, &inet6_sk(addr_sk)->
daddr);
524 return tcp_v6_md5_do_lookup(sk, &inet6_rsk(req)->rmt_addr);
527 static int tcp_v6_parse_md5_keys (
struct sock *sk,
char __user *optval,
533 if (optlen <
sizeof(
cmd))
542 if (!
cmd.tcpm_keylen) {
543 if (ipv6_addr_v4mapped(&sin6->
sin6_addr))
553 if (ipv6_addr_v4mapped(&sin6->
sin6_addr))
576 return crypto_hash_update(&hp->
md5_desc, &
sg,
sizeof(*bp));
588 goto clear_hash_noput;
591 if (crypto_hash_init(desc))
593 if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2))
599 if (crypto_hash_final(desc, md5_hash))
612 static int tcp_v6_md5_hash_skb(
char *md5_hash,
struct tcp_md5sig_key *key,
613 const struct sock *sk,
620 const struct tcphdr *th = tcp_hdr(skb);
623 saddr = &inet6_sk(sk)->saddr;
624 daddr = &inet6_sk(sk)->daddr;
626 saddr = &inet6_rsk(req)->loc_addr;
627 daddr = &inet6_rsk(req)->rmt_addr;
629 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
630 saddr = &ip6h->
saddr;
631 daddr = &ip6h->
daddr;
636 goto clear_hash_noput;
639 if (crypto_hash_init(desc))
642 if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, skb->
len))
650 if (crypto_hash_final(desc, md5_hash))
663 static int tcp_v6_inbound_md5_hash(
struct sock *sk,
const struct sk_buff *skb)
667 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
668 const struct tcphdr *th = tcp_hdr(skb);
672 hash_expected = tcp_v6_md5_do_lookup(sk, &ip6h->
saddr);
676 if (!hash_expected && !hash_location)
679 if (hash_expected && !hash_location) {
684 if (!hash_expected && hash_location) {
690 genhash = tcp_v6_md5_hash_skb(newhash,
694 if (genhash ||
memcmp(hash_location, newhash, 16) != 0) {
696 genhash ?
"failed" :
"mismatch",
708 .rtx_syn_ack = tcp_v6_rtx_synack,
709 .send_ack = tcp_v6_reqsk_send_ack,
710 .destructor = tcp_v6_reqsk_destructor,
711 .send_reset = tcp_v6_send_reset,
715 #ifdef CONFIG_TCP_MD5SIG
717 .md5_lookup = tcp_v6_reqsk_md5_lookup,
718 .calc_md5_hash = tcp_v6_md5_hash_skb,
722 static void __tcp_v6_send_check(
struct sk_buff *skb,
725 struct tcphdr *th = tcp_hdr(skb);
728 th->
check = ~tcp_v6_check(skb->
len, saddr, daddr, 0);
732 th->
check = tcp_v6_check(skb->
len, saddr, daddr,
738 static void tcp_v6_send_check(
struct sock *sk,
struct sk_buff *skb)
742 __tcp_v6_send_check(skb, &np->
saddr, &np->
daddr);
745 static int tcp_v6_gso_send_check(
struct sk_buff *skb)
750 if (!pskb_may_pull(skb,
sizeof(*th)))
753 ipv6h = ipv6_hdr(skb);
758 __tcp_v6_send_check(skb, &ipv6h->
saddr, &ipv6h->
daddr);
765 const struct ipv6hdr *iph = skb_gro_network_header(skb);
771 if (!tcp_v6_check(skb_gro_len(skb), &iph->
saddr, &iph->
daddr,
798 static int tcp6_gro_complete(
struct sk_buff *skb)
800 const struct ipv6hdr *iph = ipv6_hdr(skb);
801 struct tcphdr *th = tcp_hdr(skb);
803 th->
check = ~tcp_v6_check(skb->
len - skb_transport_offset(skb),
813 const struct tcphdr *th = tcp_hdr(skb);
817 struct net *net = dev_net(skb_dst(skb)->
dev);
818 struct sock *ctl_sk = net->ipv6.tcp_sk;
819 unsigned int tot_len =
sizeof(
struct tcphdr);
825 #ifdef CONFIG_TCP_MD5SIG
838 skb_reset_transport_header(buff);
841 memset(t1, 0,
sizeof(*t1));
844 t1->doff = tot_len / 4;
847 t1->ack = !rst || !th->ack;
851 topt = (
__be32 *)(t1 + 1);
860 #ifdef CONFIG_TCP_MD5SIG
864 tcp_v6_md5_hash_hdr((
__u8 *)topt, key,
865 &ipv6_hdr(skb)->saddr,
866 &ipv6_hdr(skb)->daddr, t1);
870 memset(&fl6, 0,
sizeof(fl6));
871 fl6.
daddr = ipv6_hdr(skb)->saddr;
872 fl6.
saddr = ipv6_hdr(skb)->daddr;
877 __tcp_v6_send_check(buff, &fl6.
saddr, &fl6.
daddr);
880 if (ipv6_addr_type(&fl6.
daddr) & IPV6_ADDR_LINKLOCAL)
881 fl6.flowi6_oif = inet6_iif(skb);
882 fl6.fl6_dport = t1->
dest;
883 fl6.fl6_sport = t1->
source;
884 security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
892 skb_dst_set(buff, dst);
903 static void tcp_v6_send_reset(
struct sock *sk,
struct sk_buff *skb)
905 const struct tcphdr *th = tcp_hdr(skb);
908 #ifdef CONFIG_TCP_MD5SIG
910 struct ipv6hdr *ipv6h = ipv6_hdr(skb);
911 unsigned char newhash[16];
919 if (!ipv6_unicast_destination(skb))
922 #ifdef CONFIG_TCP_MD5SIG
924 if (!sk && hash_location) {
939 key = tcp_v6_md5_do_lookup(sk1, &ipv6h->
saddr);
943 genhash = tcp_v6_md5_hash_skb(newhash, key,
NULL,
NULL, skb);
944 if (genhash ||
memcmp(hash_location, newhash, 16) != 0)
947 key = sk ? tcp_v6_md5_do_lookup(sk, &ipv6h->
saddr) :
NULL;
954 ack_seq =
ntohl(th->
seq) + th->syn + th->fin + skb->
len -
957 tcp_v6_send_response(skb, seq, ack_seq, 0, 0, key, 1, 0);
959 #ifdef CONFIG_TCP_MD5SIG
971 tcp_v6_send_response(skb, seq, ack, win, ts, key, 0, tclass);
974 static void tcp_v6_timewait_ack(
struct sock *sk,
struct sk_buff *skb)
987 static void tcp_v6_reqsk_send_ack(
struct sock *sk,
struct sk_buff *skb,
990 tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->
rcv_wnd, req->
ts_recent,
991 tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr), 0);
995 static struct sock *tcp_v6_hnd_req(
struct sock *sk,
struct sk_buff *skb)
998 const struct tcphdr *th = tcp_hdr(skb);
1003 &ipv6_hdr(skb)->saddr,
1004 &ipv6_hdr(skb)->daddr, inet6_iif(skb));
1009 &ipv6_hdr(skb)->saddr, th->
source,
1010 &ipv6_hdr(skb)->daddr,
ntohs(th->
dest), inet6_iif(skb));
1021 #ifdef CONFIG_SYN_COOKIES
1031 static int tcp_v6_conn_request(
struct sock *sk,
struct sk_buff *skb)
1035 const u8 *hash_location;
1043 bool want_cookie =
false;
1048 if (!ipv6_unicast_destination(skb))
1051 if (inet_csk_reqsk_queue_is_full(sk) && !isn) {
1057 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
1060 req = inet6_reqsk_alloc(&tcp6_request_sock_ops);
1064 #ifdef CONFIG_TCP_MD5SIG
1065 tcp_rsk(req)->af_specific = &tcp_request_sock_ipv6_ops;
1068 tcp_clear_options(&tmp_opt);
1070 tmp_opt.user_mss = tp->
rx_opt.user_mss;
1073 if (tmp_opt.cookie_plus > 0 &&
1074 tmp_opt.saw_tstamp &&
1075 !tp->
rx_opt.cookie_out_never &&
1076 (sysctl_tcp_cookie_size > 0 ||
1088 d = (
__force u32 *)&ipv6_hdr(skb)->daddr.s6_addr32[0];
1093 d = (
__force u32 *)&ipv6_hdr(skb)->saddr.s6_addr32[0];
1102 *c++ ^= *hash_location++;
1104 want_cookie =
false;
1106 tmp_ext.cookie_plus = tmp_opt.cookie_plus;
1107 }
else if (!tp->
rx_opt.cookie_in_always) {
1116 if (want_cookie && !tmp_opt.saw_tstamp)
1117 tcp_clear_options(&tmp_opt);
1119 tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
1120 tcp_openreq_init(req, &tmp_opt, skb);
1122 treq = inet6_rsk(req);
1123 treq->
rmt_addr = ipv6_hdr(skb)->saddr;
1124 treq->
loc_addr = ipv6_hdr(skb)->daddr;
1125 if (!want_cookie || tmp_opt.tstamp_ok)
1126 TCP_ECN_create_request(req, skb);
1128 treq->
iif = sk->sk_bound_dev_if;
1131 if (!sk->sk_bound_dev_if &&
1132 ipv6_addr_type(&treq->
rmt_addr) & IPV6_ADDR_LINKLOCAL)
1133 treq->
iif = inet6_iif(skb);
1158 if (tmp_opt.saw_tstamp &&
1163 goto drop_and_release;
1167 else if (!sysctl_tcp_syncookies &&
1180 goto drop_and_release;
1183 isn = tcp_v6_init_sequence(skb);
1186 tcp_rsk(req)->snt_isn = isn;
1188 if (security_inet_conn_request(sk, skb, req))
1189 goto drop_and_release;
1191 if (tcp_v6_send_synack(sk, dst, &fl6, req,
1193 skb_get_queue_mapping(skb)) ||
1198 tcp_rsk(req)->listener =
NULL;
1210 static struct sock * tcp_v6_syn_recv_sock(
struct sock *sk,
struct sk_buff *skb,
1215 struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
1220 #ifdef CONFIG_TCP_MD5SIG
1236 inet_sk(newsk)->pinet6 = &newtcp6sk->
inet6;
1238 newinet = inet_sk(newsk);
1239 newnp = inet6_sk(newsk);
1240 newtp = tcp_sk(newsk);
1244 ipv6_addr_set_v4mapped(newinet->inet_daddr, &newnp->
daddr);
1250 inet_csk(newsk)->icsk_af_ops = &ipv6_mapped;
1252 #ifdef CONFIG_TCP_MD5SIG
1253 newtp->af_specific = &tcp_sock_ipv6_mapped_specific;
1261 newnp->
mcast_hops = ipv6_hdr(skb)->hop_limit;
1262 newnp->
rcv_tclass = ipv6_tclass(ipv6_hdr(skb));
1274 tcp_sync_mss(newsk, inet_csk(newsk)->icsk_pmtu_cookie);
1279 treq = inet6_rsk(req);
1281 if (sk_acceptq_is_full(sk))
1301 __ip6_dst_store(newsk, dst,
NULL,
NULL);
1302 inet6_sk_rx_dst_set(newsk, skb);
1305 inet_sk(newsk)->pinet6 = &newtcp6sk->
inet6;
1307 newtp = tcp_sk(newsk);
1308 newinet = inet_sk(newsk);
1309 newnp = inet6_sk(newsk);
1316 newsk->sk_bound_dev_if = treq->
iif;
1341 newnp->
mcast_hops = ipv6_hdr(skb)->hop_limit;
1342 newnp->
rcv_tclass = ipv6_tclass(ipv6_hdr(skb));
1353 inet_csk(newsk)->icsk_ext_hdr_len = 0;
1355 inet_csk(newsk)->icsk_ext_hdr_len = (newnp->
opt->opt_nflen +
1356 newnp->
opt->opt_flen);
1360 newtp->
advmss = dst_metric_advmss(dst);
1361 if (tcp_sk(sk)->rx_opt.user_mss &&
1362 tcp_sk(sk)->rx_opt.user_mss < newtp->
advmss)
1363 newtp->
advmss = tcp_sk(sk)->rx_opt.user_mss;
1366 tcp_synack_rtt_meas(newsk, req);
1372 #ifdef CONFIG_TCP_MD5SIG
1374 if ((key = tcp_v6_md5_do_lookup(sk, &newnp->
daddr)) !=
NULL) {
1406 if (!tcp_v6_check(skb->
len, &ipv6_hdr(skb)->saddr,
1407 &ipv6_hdr(skb)->daddr, skb->
csum)) {
1413 skb->
csum = ~csum_unfold(tcp_v6_check(skb->
len,
1414 &ipv6_hdr(skb)->saddr,
1415 &ipv6_hdr(skb)->daddr, 0));
1417 if (skb->
len <= 76) {
1431 static int tcp_v6_do_rcv(
struct sock *sk,
struct sk_buff *skb)
1448 #ifdef CONFIG_TCP_MD5SIG
1449 if (tcp_v6_inbound_md5_hash (sk, skb))
1480 sock_rps_save_rxhash(sk, skb);
1482 if (inet_sk(sk)->rx_dst_ifindex != skb->
skb_iif ||
1492 goto ipv6_pktoptions;
1496 if (skb->
len < tcp_hdrlen(skb) || tcp_checksum_complete(skb))
1500 struct sock *nsk = tcp_v6_hnd_req(sk, skb);
1510 sock_rps_save_rxhash(nsk, skb);
1518 sock_rps_save_rxhash(sk, skb);
1523 goto ipv6_pktoptions;
1527 tcp_v6_send_reset(sk, skb);
1552 np->
mcast_hops = ipv6_hdr(opt_skb)->hop_limit;
1556 skb_set_owner_r(opt_skb, sk);
1568 static int tcp_v6_rcv(
struct sk_buff *skb)
1574 struct net *net = dev_net(skb->
dev);
1584 if (!pskb_may_pull(skb,
sizeof(
struct tcphdr)))
1589 if (th->doff <
sizeof(
struct tcphdr)/4)
1591 if (!pskb_may_pull(skb, th->doff*4))
1594 if (!skb_csum_unnecessary(skb) && tcp_v6_checksum_init(skb))
1598 hdr = ipv6_hdr(skb);
1601 skb->
len - th->doff*4);
1604 TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr);
1615 if (hdr->
hop_limit < inet6_sk(sk)->min_hopcount) {
1617 goto discard_and_relse;
1621 goto discard_and_relse;
1624 goto discard_and_relse;
1631 #ifdef CONFIG_NET_DMA
1633 if (!tp->
ucopy.dma_chan && tp->
ucopy.pinned_list)
1635 if (tp->
ucopy.dma_chan)
1636 ret = tcp_v6_do_rcv(sk, skb);
1640 if (!tcp_prequeue(sk, skb))
1641 ret = tcp_v6_do_rcv(sk, skb);
1643 }
else if (
unlikely(sk_add_backlog(sk, skb,
1647 goto discard_and_relse;
1652 return ret ? -1 : 0;
1658 if (skb->
len < (th->doff<<2) || tcp_checksum_complete(skb)) {
1662 tcp_v6_send_reset(
NULL, skb);
1684 if (skb->
len < (th->doff<<2) || tcp_checksum_complete(skb)) {
1696 &ipv6_hdr(skb)->daddr,
1708 tcp_v6_timewait_ack(sk, skb);
1717 static void tcp_v6_early_demux(
struct sk_buff *skb)
1726 if (!pskb_may_pull(skb, skb_transport_offset(skb) +
sizeof(
struct tcphdr)))
1729 hdr = ipv6_hdr(skb);
1732 if (th->doff <
sizeof(
struct tcphdr) / 4)
1746 dst = dst_check(dst, inet6_sk(sk)->rx_dst_cookie);
1762 .send_check = tcp_v6_send_check,
1764 .sk_rx_dst_set = inet6_sk_rx_dst_set,
1765 .conn_request = tcp_v6_conn_request,
1766 .syn_recv_sock = tcp_v6_syn_recv_sock,
1767 .net_header_len =
sizeof(
struct ipv6hdr),
1768 .net_frag_header_len =
sizeof(
struct frag_hdr),
1774 #ifdef CONFIG_COMPAT
1780 #ifdef CONFIG_TCP_MD5SIG
1782 .md5_lookup = tcp_v6_md5_lookup,
1783 .calc_md5_hash = tcp_v6_md5_hash_skb,
1784 .md5_parse = tcp_v6_parse_md5_keys,
1797 .conn_request = tcp_v6_conn_request,
1798 .syn_recv_sock = tcp_v6_syn_recv_sock,
1799 .net_header_len =
sizeof(
struct iphdr),
1805 #ifdef CONFIG_COMPAT
1811 #ifdef CONFIG_TCP_MD5SIG
1815 .md5_parse = tcp_v6_parse_md5_keys,
1822 static int tcp_v6_init_sock(
struct sock *sk)
1830 #ifdef CONFIG_TCP_MD5SIG
1831 tcp_sk(sk)->af_specific = &tcp_sock_ipv6_specific;
1837 static void tcp_v6_destroy_sock(
struct sock *sk)
1843 #ifdef CONFIG_PROC_FS
1845 static void get_openreq6(
struct seq_file *seq,
1849 const struct in6_addr *
src = &inet6_rsk(req)->loc_addr;
1850 const struct in6_addr *
dest = &inet6_rsk(req)->rmt_addr;
1856 "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
1857 "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK\n",
1859 src->s6_addr32[0], src->s6_addr32[1],
1860 src->s6_addr32[2], src->s6_addr32[3],
1861 ntohs(inet_rsk(req)->loc_port),
1862 dest->s6_addr32[0], dest->s6_addr32[1],
1863 dest->s6_addr32[2], dest->s6_addr32[3],
1864 ntohs(inet_rsk(req)->rmt_port),
1876 static void get_tcp6_sock(
struct seq_file *seq,
struct sock *
sp,
int i)
1882 const struct inet_sock *inet = inet_sk(sp);
1883 const struct tcp_sock *tp = tcp_sk(sp);
1898 }
else if (timer_pending(&sp->
sk_timer)) {
1900 timer_expires = sp->
sk_timer.expires;
1907 "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
1908 "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %pK %lu %lu %u %u %d\n",
1910 src->s6_addr32[0], src->s6_addr32[1],
1911 src->s6_addr32[2], src->s6_addr32[3], srcp,
1912 dest->s6_addr32[0], dest->s6_addr32[1],
1913 dest->s6_addr32[2], dest->s6_addr32[3], destp,
1918 jiffies_delta_to_clock_t(timer_expires - jiffies),
1932 static void get_timewait6_sock(
struct seq_file *seq,
1946 "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
1947 "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK\n",
1949 src->s6_addr32[0], src->s6_addr32[1],
1950 src->s6_addr32[2], src->s6_addr32[3], srcp,
1951 dest->s6_addr32[0], dest->s6_addr32[1],
1952 dest->s6_addr32[2], dest->s6_addr32[3], destp,
1954 3, jiffies_delta_to_clock_t(delta), 0, 0, 0, 0,
1958 static int tcp6_seq_show(
struct seq_file *seq,
void *
v)
1967 "st tx_queue rx_queue tr tm->when retrnsmt"
1968 " uid timeout inode\n");
1973 switch (st->
state) {
1976 get_tcp6_sock(seq, v, st->
num);
1982 get_timewait6_sock(seq, v, st->
num);
2000 .seq_fops = &tcp6_afinfo_seq_fops,
2002 .show = tcp6_seq_show,
2006 int __net_init tcp6_proc_init(
struct net *net)
2011 void tcp6_proc_exit(
struct net *net)
2021 .connect = tcp_v6_connect,
2025 .init = tcp_v6_init_sock,
2026 .destroy = tcp_v6_destroy_sock,
2033 .backlog_rcv = tcp_v6_do_rcv,
2035 .mtu_reduced = tcp_v6_mtu_reduced,
2036 .hash = tcp_v6_hash,
2049 .twsk_prot = &tcp6_timewait_sock_ops,
2052 .no_autobind =
true,
2053 #ifdef CONFIG_COMPAT
2057 #ifdef CONFIG_MEMCG_KMEM
2062 static const struct inet6_protocol tcpv6_protocol = {
2063 .early_demux = tcp_v6_early_demux,
2064 .handler = tcp_v6_rcv,
2065 .err_handler = tcp_v6_err,
2066 .gso_send_check = tcp_v6_gso_send_check,
2068 .gro_receive = tcp6_gro_receive,
2069 .gro_complete = tcp6_gro_complete,
2070 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
2083 static int __net_init tcpv6_net_init(
struct net *net)
2089 static void __net_exit tcpv6_net_exit(
struct net *net)
2091 inet_ctl_sock_destroy(net->ipv6.tcp_sk);
2100 .init = tcpv6_net_init,
2101 .exit = tcpv6_net_exit,
2102 .exit_batch = tcpv6_net_exit_batch,
2116 goto out_tcpv6_protocol;
2120 goto out_tcpv6_protosw;