Home | History | Annotate | Line # | Download | only in netinet6
in6_proto.c revision 1.8
      1 /*	$NetBSD: in6_proto.c,v 1.8 1999/07/31 18:41:16 itojun Exp $	*/
      2 
      3 /*
      4  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. Neither the name of the project nor the names of its contributors
     16  *    may be used to endorse or promote products derived from this software
     17  *    without specific prior written permission.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  * SUCH DAMAGE.
     30  */
     31 
     32 /*
     33  * Copyright (c) 1982, 1986, 1993
     34  *	The Regents of the University of California.  All rights reserved.
     35  *
     36  * Redistribution and use in source and binary forms, with or without
     37  * modification, are permitted provided that the following conditions
     38  * are met:
     39  * 1. Redistributions of source code must retain the above copyright
     40  *    notice, this list of conditions and the following disclaimer.
     41  * 2. Redistributions in binary form must reproduce the above copyright
     42  *    notice, this list of conditions and the following disclaimer in the
     43  *    documentation and/or other materials provided with the distribution.
     44  * 3. All advertising materials mentioning features or use of this software
     45  *    must display the following acknowledgement:
     46  *	This product includes software developed by the University of
     47  *	California, Berkeley and its contributors.
     48  * 4. Neither the name of the University nor the names of its contributors
     49  *    may be used to endorse or promote products derived from this software
     50  *    without specific prior written permission.
     51  *
     52  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     53  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     54  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     55  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     56  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     57  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     58  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     59  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     60  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     61  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     62  * SUCH DAMAGE.
     63  *
     64  *	@(#)in_proto.c	8.1 (Berkeley) 6/10/93
     65  */
     66 
     67 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__)
     68 #include "opt_inet.h"
     69 #ifdef __NetBSD__	/*XXX*/
     70 #include "opt_ipsec.h"
     71 #endif
     72 #endif
     73 
     74 #include <sys/param.h>
     75 #include <sys/socket.h>
     76 #include <sys/protosw.h>
     77 #include <sys/kernel.h>
     78 #include <sys/domain.h>
     79 #include <sys/mbuf.h>
     80 
     81 #include <net/if.h>
     82 #include <net/radix.h>
     83 #include <net/route.h>
     84 
     85 #include <netinet/in.h>
     86 #include <netinet/in_systm.h>
     87 #include <netinet/in_var.h>
     88 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6))
     89 #include <netinet/ip.h>
     90 #include <netinet/ip_var.h>
     91 #endif
     92 #if defined(__NetBSD__) && !defined(TCP6)
     93 #include <netinet/in_pcb.h>
     94 #endif
     95 #include <netinet6/ip6.h>
     96 #include <netinet6/ip6_var.h>
     97 #include <netinet6/icmp6.h>
     98 #if !defined(__FreeBSD__) || __FreeBSD__ < 3
     99 #include <netinet6/in6_pcb.h>
    100 #endif
    101 
    102 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3)
    103 #include <netinet/tcp.h>
    104 #include <netinet/tcp_timer.h>
    105 #include <netinet/tcp_var.h>
    106 #include <netinet/udp.h>
    107 #include <netinet/udp_var.h>
    108 #else
    109 #if defined(__NetBSD__) && !defined(TCP6)
    110 #include <netinet/tcp.h>
    111 #include <netinet/tcp_fsm.h>
    112 #include <netinet/tcp_seq.h>
    113 #include <netinet/tcp_timer.h>
    114 #include <netinet/tcp_var.h>
    115 #include <netinet/tcpip.h>
    116 #include <netinet/tcp_debug.h>
    117 #else
    118 #include <netinet6/tcp6.h>
    119 #include <netinet6/tcp6_fsm.h>
    120 #include <netinet6/tcp6_seq.h>
    121 #include <netinet6/tcp6_timer.h>
    122 #include <netinet6/tcp6_var.h>
    123 #endif
    124 #endif
    125 
    126 #include <netinet6/udp6.h>
    127 #include <netinet6/udp6_var.h>
    128 
    129 #include <netinet6/pim6_var.h>
    130 
    131 #include <netinet6/nd6.h>
    132 
    133 #ifdef IPSEC
    134 #include <netinet6/ah.h>
    135 #ifdef IPSEC_ESP
    136 #include <netinet6/esp.h>
    137 #endif
    138 #include <netinet6/ipcomp.h>
    139 #endif /*IPSEC*/
    140 
    141 #include <netinet6/ip6protosw.h>
    142 
    143 #include "gif.h"
    144 #if NGIF > 0
    145 #include <netinet6/in6_gif.h>
    146 #endif
    147 
    148 #define	offsetof(type, member)	((size_t)(&((type *)0)->member))
    149 
    150 /*
    151  * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
    152  */
    153 
    154 extern	struct domain inet6domain;
    155 
    156 struct ip6protosw inet6sw[] = {
    157 { 0,		&inet6domain,	IPPROTO_IPV6,	0,
    158   0,		0,		0,		0,
    159   0,
    160   ip6_init,	0,		frag6_slowtimo,	frag6_drain,	ip6_sysctl
    161 },
    162 { SOCK_DGRAM,	&inet6domain,	IPPROTO_UDP,	PR_ATOMIC | PR_ADDR,
    163   udp6_input,	0,		udp6_ctlinput,	ip6_ctloutput,
    164   udp6_usrreq,
    165   udp6_init,	0,		0,		0,		udp6_sysctl
    166 },
    167 #ifdef TCP6
    168 { SOCK_STREAM,	&inet6domain,	IPPROTO_TCP,	PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN,
    169   tcp6_input,	0,		tcp6_ctlinput,	tcp6_ctloutput,
    170   tcp6_usrreq,
    171   tcp6_init,	tcp6_fasttimo,	tcp6_slowtimo,	tcp6_drain,	tcp6_sysctl
    172 },
    173 #else
    174 { SOCK_STREAM,	&inet6domain,	IPPROTO_TCP,	PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN,
    175   tcp6_input,	0,		tcp6_ctlinput,	tcp_ctloutput,
    176   tcp_usrreq,
    177 #ifdef INET
    178   /* If inet4, no need to have tcp_slowtimo and tcp_fasttimo happen TWICE */
    179   tcp_init,	NULL,		NULL,		tcp_drain,	tcp_sysctl
    180 #else
    181   tcp_init,	tcp_fasttimo,	tcp_slowtimo,	tcp_drain,	tcp_sysctl
    182 #endif
    183 },
    184 #endif
    185 { SOCK_RAW,	&inet6domain,	IPPROTO_RAW,	PR_ATOMIC | PR_ADDR,
    186   rip6_input,	rip6_output,	0,		rip6_ctloutput,
    187   rip6_usrreq,
    188   0,		0,		0,		0,		0
    189 },
    190 { SOCK_RAW,	&inet6domain,	IPPROTO_ICMPV6,	PR_ATOMIC | PR_ADDR,
    191   icmp6_input,	rip6_output,	0,		rip6_ctloutput,
    192   rip6_usrreq,
    193   icmp6_init,	icmp6_fasttimo,	0,		0,		icmp6_sysctl
    194 },
    195 { SOCK_RAW,	&inet6domain,	IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR,
    196   dest6_input,	0,	 	0,		0,
    197   0,
    198   0,		0,		0,		0,
    199 },
    200 { SOCK_RAW,	&inet6domain,	IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR,
    201   route6_input,	0,	 	0,		0,
    202   0,
    203   0,		0,		0,		0,
    204 },
    205 { SOCK_RAW,	&inet6domain,	IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR,
    206   frag6_input,	0,	 	0,		0,
    207   0,
    208   0,		0,		0,		0,
    209 },
    210 #ifdef IPSEC
    211 { SOCK_RAW,	&inet6domain,	IPPROTO_AH,	PR_ATOMIC|PR_ADDR,
    212   ah6_input,	0,	 	0,		0,
    213   0,
    214   0,		0,		0,		0,		ipsec6_sysctl
    215 },
    216 #ifdef IPSEC_ESP
    217 { SOCK_RAW,	&inet6domain,	IPPROTO_ESP,	PR_ATOMIC|PR_ADDR,
    218   esp6_input,	0,	 	0,		0,
    219   0,
    220   0,		0,		0,		0,		ipsec6_sysctl
    221 },
    222 #endif
    223 { SOCK_RAW,	&inet6domain,	IPPROTO_IPCOMP,	PR_ATOMIC|PR_ADDR,
    224   ipcomp6_input, 0,	 	0,		0,
    225   0,
    226   0,		0,		0,		0,		ipsec6_sysctl
    227 },
    228 #endif /* IPSEC */
    229 #if NGIF > 0
    230 { SOCK_RAW,	&inet6domain,	IPPROTO_IPV4,	PR_ATOMIC|PR_ADDR,
    231   in6_gif_input,0,	 	0,		0,
    232   0,
    233   0,		0,		0,		0,
    234 },
    235 #ifdef INET6
    236 { SOCK_RAW,	&inet6domain,	IPPROTO_IPV6,	PR_ATOMIC|PR_ADDR,
    237   in6_gif_input,0,	 	0,		0,
    238   0,
    239   0,		0,		0,		0,
    240 },
    241 #endif /* INET6 */
    242 #endif /* GIF */
    243 { SOCK_RAW,     &inet6domain,	IPPROTO_PIM,	PR_ATOMIC|PR_ADDR,
    244   pim6_input,    rip6_output,	0,              rip6_ctloutput,
    245   rip6_usrreq,
    246   0,            0,              0,              0,
    247 },
    248 /* raw wildcard */
    249 { SOCK_RAW,	&inet6domain,	0,		PR_ATOMIC | PR_ADDR,
    250   rip6_input,	rip6_output,	0,		rip6_ctloutput,
    251   rip6_usrreq,
    252   rip6_init,	0,		0,		0,
    253 },
    254 };
    255 
    256 struct domain inet6domain =
    257     { AF_INET6, "internet6", 0, 0, 0,
    258       (struct protosw *)inet6sw,
    259       (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0,
    260       rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3,
    261       sizeof(struct sockaddr_in6) };
    262 
    263 #ifdef __FreeBSD__
    264 DOMAIN_SET(inet6);
    265 #endif
    266 
    267 /*
    268  * Internet configuration info
    269  */
    270 #ifndef	IPV6FORWARDING
    271 #ifdef GATEWAY6
    272 #define	IPV6FORWARDING	1	/* forward IP6 packets not for us */
    273 #else
    274 #define	IPV6FORWARDING	0	/* don't forward IP6 packets not for us */
    275 #endif /* GATEWAY6 */
    276 #endif /* !IPV6FORWARDING */
    277 
    278 #ifndef	IPV6_SENDREDIRECTS
    279 #define	IPV6_SENDREDIRECTS	1
    280 #endif
    281 
    282 int	ip6_forwarding = IPV6FORWARDING;	/* act as router? */
    283 int	ip6_sendredirects = IPV6_SENDREDIRECTS;
    284 int	ip6_defhlim = IPV6_DEFHLIM;
    285 int	ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
    286 int	ip6_accept_rtadv = 0;	/* "IPV6FORWARDING ? 0 : 1" is dangerous */
    287 int	ip6_maxfragpackets = 200;
    288 int	ip6_log_interval = 5;
    289 int	ip6_hdrnestlimit = 50;	/* appropriate? */
    290 int	ip6_dad_count = 1;	/* DupAddrDetectionTransmits */
    291 u_int32_t ip6_flow_seq;
    292 int	ip6_auto_flowlabel = 1;
    293 #if NGIF > 0
    294 int	ip6_gif_hlim = GIF_HLIM;
    295 #else
    296 int	ip6_gif_hlim = 0;
    297 #endif
    298 
    299 u_int32_t ip6_id = 0UL;
    300 int	ip6_keepfaith = 0;
    301 time_t	ip6_log_time = (time_t)0L;
    302 
    303 /* icmp6 */
    304 int pmtu_expire = 60*10;
    305 int pmtu_probe = 60*2;
    306 
    307 /* raw IP6 parameters */
    308 /*
    309  * Nominal space allocated to a raw ip socket.
    310  */
    311 #define	RIPV6SNDQ	8192
    312 #define	RIPV6RCVQ	8192
    313 
    314 u_long	rip6_sendspace = RIPV6SNDQ;
    315 u_long	rip6_recvspace = RIPV6RCVQ;
    316 
    317 /* ICMPV6 parameters */
    318 int	icmp6_rediraccept = 1;		/* accept and process redirects */
    319 int	icmp6_redirtimeout = 10 * 60;	/* 10 minutes */
    320 u_int	icmp6errratelim = 1000;		/* 1000usec = 1msec */
    321 
    322 #ifdef TCP6
    323 /* TCP on IP6 parameters */
    324 int	tcp6_sendspace = 1024 * 8;
    325 int	tcp6_recvspace = 1024 * 8;
    326 int 	tcp6_mssdflt = TCP6_MSS;
    327 int 	tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ;
    328 int	tcp6_do_rfc1323 = 1;
    329 int	tcp6_conntimeo = TCP6TV_KEEP_INIT;	/* initial connection timeout */
    330 int	tcp6_43maxseg = 0;
    331 int	tcp6_pmtu = 0;
    332 
    333 /*
    334  * Parameters for keepalive option.
    335  * Connections for which SO_KEEPALIVE is set will be probed
    336  * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ).
    337  * Starting at that time, the connection is probed at intervals
    338  * of tcp6_keepintvl (same units) until a response is received
    339  * or until tcp6_keepcnt probes have been made, at which time
    340  * the connection is dropped.  Note that a tcp6_keepidle value
    341  * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements.
    342  */
    343 int	tcp6_keepidle = TCP6TV_KEEP_IDLE;	/* time before probing idle */
    344 int	tcp6_keepintvl = TCP6TV_KEEPINTVL;	/* interval betwn idle probes */
    345 int	tcp6_keepcnt = TCP6TV_KEEPCNT;		/* max idle probes */
    346 int	tcp6_maxpersistidle = TCP6TV_KEEP_IDLE;	/* max idle time in persist */
    347 
    348 #ifndef INET_SERVER
    349 #define	TCP6_LISTEN_HASH_SIZE	17
    350 #define	TCP6_CONN_HASH_SIZE	97
    351 #define	TCP6_SYN_HASH_SIZE	293
    352 #define	TCP6_SYN_BUCKET_SIZE	35
    353 #else
    354 #define	TCP6_LISTEN_HASH_SIZE	97
    355 #define	TCP6_CONN_HASH_SIZE	9973
    356 #define	TCP6_SYN_HASH_SIZE	997
    357 #define	TCP6_SYN_BUCKET_SIZE	35
    358 #endif
    359 int	tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE;
    360 int	tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE;
    361 struct	tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE],
    362 	tcp6_conn_hash[TCP6_CONN_HASH_SIZE];
    363 
    364 int	tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE;
    365 int	tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE;
    366 int	tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE;
    367 struct	syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE];
    368 struct	syn_cache_head6 *tcp6_syn_cache_first;
    369 int	tcp6_syn_cache_interval = 8;	/* runs timer every 4 seconds */
    370 int	tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT;
    371 
    372 /*
    373  * Parameters for computing a desirable data segment size
    374  * given an upper bound (either interface MTU, or peer's MSS option)_.
    375  * As applications tend to use a buffer size that is a multiple
    376  * of kilobytes, try for something that divides evenly. However,
    377  * do not round down too much.
    378  *
    379  * Round segment size down to a multiple of TCP6_ROUNDSIZE if this
    380  * does not result in lowering by more than (size/TCP6_ROUNDFRAC).
    381  * For example, round 536 to 512.  Older versions of the system
    382  * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with
    383  * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect).
    384  * We round to a multiple of 256 for SLIP.
    385  */
    386 #ifndef	TCP6_ROUNDSIZE
    387 #define	TCP6_ROUNDSIZE	256	/* round to multiple of 256 */
    388 #endif
    389 #ifndef	TCP6_ROUNDFRAC
    390 #define	TCP6_ROUNDFRAC	10	/* round down at most N/10, or 10% */
    391 #endif
    392 
    393 int	tcp6_roundsize = TCP6_ROUNDSIZE;
    394 int	tcp6_roundfrac = TCP6_ROUNDFRAC;
    395 #endif /*TCP6*/
    396 
    397 /* UDP on IP6 parameters */
    398 int	udp6_sendspace = 9216;		/* really max datagram size */
    399 int	udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
    400 					/* 40 1K datagrams */
    401 
    402 #ifdef __FreeBSD__
    403 /*
    404  * sysctl related items.
    405  */
    406 SYSCTL_NODE(_net,	PF_INET6,	inet6,	CTLFLAG_RW,	0,
    407 	"Internet6 Family");
    408 
    409 /* net.inet6 */
    410 SYSCTL_NODE(_net_inet6,	IPPROTO_IPV6,	ip6,	CTLFLAG_RW, 0,	"IP6");
    411 SYSCTL_NODE(_net_inet6,	IPPROTO_ICMPV6,	icmp6,	CTLFLAG_RW, 0,	"ICMP6");
    412 SYSCTL_NODE(_net_inet6,	IPPROTO_UDP,	udp6,	CTLFLAG_RW, 0,	"UDP6");
    413 SYSCTL_NODE(_net_inet6,	IPPROTO_TCP,	tcp6,	CTLFLAG_RW, 0,	"TCP6");
    414 #ifdef IPSEC
    415 SYSCTL_NODE(_net_inet6,	IPPROTO_ESP,	ipsec6,	CTLFLAG_RW, 0,	"IPSEC6");
    416 #endif /* IPSEC */
    417 
    418 /* net.inet6.ip6 */
    419 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING,
    420 	forwarding, CTLFLAG_RW,		&ip6_forwarding,	0, "");
    421 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS,
    422 	redirect, CTLFLAG_RW,		&ip6_sendredirects,	0, "");
    423 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM,
    424 	hlim, CTLFLAG_RW,		&ip6_defhlim,	0, "");
    425 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS,
    426 	maxfragpackets, CTLFLAG_RW,	&ip6_maxfragpackets,	0, "");
    427 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV,
    428 	accept_rtadv, CTLFLAG_RW,	&ip6_accept_rtadv,	0, "");
    429 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH,
    430 	keepfaith, CTLFLAG_RW,		&ip6_keepfaith,	0, "");
    431 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL,
    432 	log_interval, CTLFLAG_RW,	&ip6_log_interval,	0, "");
    433 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT,
    434 	hdrnestlimit, CTLFLAG_RW,	&ip6_hdrnestlimit,	0, "");
    435 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT,
    436 	dad_count, CTLFLAG_RW,	&ip6_dad_count,	0, "");
    437 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL,
    438 	auto_flowlabel, CTLFLAG_RW,	&ip6_auto_flowlabel,	0, "");
    439 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM,
    440 	defmcasthlim, CTLFLAG_RW,	&ip6_defmcasthlim,	0, "");
    441 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM,
    442 	gifhlim, CTLFLAG_RW,	&ip6_gif_hlim,			0, "");
    443 
    444 /* net.inet6.icmp6 */
    445 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT,
    446 	rediraccept, CTLFLAG_RW,	&icmp6_rediraccept,	0, "");
    447 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT,
    448 	redirtimeout, CTLFLAG_RW,	&icmp6_redirtimeout,	0, "");
    449 SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD,
    450 	&icmp6stat, icmp6stat, "");
    451 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRRATELIMIT,
    452 	errratelimit, CTLFLAG_RW,	&icmp6errratelim,	0, "");
    453 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE,
    454 	nd6_prune, CTLFLAG_RW,		&nd6_prune,	0, "");
    455 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY,
    456 	nd6_delay, CTLFLAG_RW,		&nd6_delay,	0, "");
    457 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES,
    458 	nd6_umaxtries, CTLFLAG_RW,	&nd6_umaxtries,	0, "");
    459 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES,
    460 	nd6_mmaxtries, CTLFLAG_RW,	&nd6_mmaxtries,	0, "");
    461 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK,
    462 	nd6_useloopback, CTLFLAG_RW,	&nd6_useloopback, 0, "");
    463 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PROXYALL,
    464 	nd6_proxyall, CTLFLAG_RW,	&nd6_proxyall, 0, "");
    465 
    466 /* net.inet6.udp6 */
    467 SYSCTL_INT(_net_inet6_udp6, UDP6CTL_SENDMAX,
    468 	sendmax, CTLFLAG_RW,	&udp6_sendspace,	0, "");
    469 SYSCTL_INT(_net_inet6_udp6, UDP6CTL_RECVSPACE,
    470 	recvspace, CTLFLAG_RW,	&udp6_recvspace,	0, "");
    471 
    472 /* net.inet6.tcp6 */
    473 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MSSDFLT,
    474 	mssdflt, CTLFLAG_RW,	&tcp6_mssdflt, 0, "");
    475 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_DO_RFC1323,
    476 	do_rfc1323, CTLFLAG_RW,	&tcp6_do_rfc1323, 0, "");
    477 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPIDLE,
    478 	keepidle, CTLFLAG_RW,	&tcp6_keepidle, 0, "");
    479 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPINTVL,
    480 	keepintvl, CTLFLAG_RW,	&tcp6_keepintvl, 0, "");
    481 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPCNT,
    482 	keepcnt, CTLFLAG_RW,	&tcp6_keepcnt, 0, "");
    483 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MAXPERSISTIDLE,
    484 	maxpersistidle, CTLFLAG_RW,	&tcp6_maxpersistidle, 0, "");
    485 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SENDSPACE,
    486 	sendspace, CTLFLAG_RW,	&tcp6_sendspace, 0, "");
    487 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_RECVSPACE,
    488 	recvspace, CTLFLAG_RW,	&tcp6_recvspace, 0, "");
    489 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_CONNTIMEO,
    490 	conntimeo, CTLFLAG_RW,	&tcp6_conntimeo, 0, "");
    491 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU,
    492 	pmtu, CTLFLAG_RW,	&tcp6_pmtu, 0, "");
    493 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_EXPIRE,
    494 	pmtu_expire, CTLFLAG_RW,	&pmtu_expire, 0, "");
    495 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_PROBE,
    496 	pmtu_probe, CTLFLAG_RW,	&pmtu_probe, 0, "");
    497 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_43MAXSEG,
    498 	pmtu_43maxseg, CTLFLAG_RW,	&tcp6_43maxseg, 0, "");
    499 SYSCTL_STRUCT(_net_inet6_tcp6, TCP6CTL_STATS, stats, CTLFLAG_RD,
    500 	&tcp6stat, tcp6stat, "");
    501 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_LIMIT,
    502 	syn_cache_limit, CTLFLAG_RW,	&tcp6_syn_cache_limit, 0, "");
    503 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_BUCKET_LIMIT,
    504 	syn_bucket_limit, CTLFLAG_RW,	&tcp6_syn_bucket_limit, 0, "");
    505 SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_INTER,
    506 	syn_cache_interval, CTLFLAG_RW, &tcp6_syn_cache_interval, 0, "");
    507 
    508 #endif /* __FreeBSD__ */
    509