inet6: emit RTM_NEWADDR messages on address flag changes.
[dragonfly.git] / sys / netinet6 / in6_proto.c
CommitLineData
984263bc
MD
1/* $FreeBSD: src/sys/netinet6/in6_proto.c,v 1.6.2.9 2003/01/24 05:11:35 sam Exp $ */
2/* $KAME: in6_proto.c,v 1.91 2001/05/27 13:28:35 itojun Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33/*
34 * Copyright (c) 1982, 1986, 1993
35 * The Regents of the University of California. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
dc71b7ab 45 * 3. Neither the name of the University nor the names of its contributors
984263bc
MD
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 * SUCH DAMAGE.
60 *
61 * @(#)in_proto.c 8.1 (Berkeley) 6/10/93
62 */
63
64#include "opt_inet.h"
65#include "opt_inet6.h"
0d16ba1d 66#include "opt_carp.h"
984263bc
MD
67
68#include <sys/param.h>
69#include <sys/socket.h>
70#include <sys/socketvar.h>
71#include <sys/protosw.h>
72#include <sys/kernel.h>
73#include <sys/domain.h>
74#include <sys/mbuf.h>
75#include <sys/systm.h>
76#include <sys/sysctl.h>
77
78#include <net/if.h>
79#include <net/radix.h>
80#include <net/route.h>
81
82#include <netinet/in.h>
83#include <netinet/in_systm.h>
84#include <netinet/in_var.h>
85#include <netinet/ip_encap.h>
86#include <netinet/ip.h>
87#include <netinet/ip_var.h>
88#include <netinet/ip6.h>
89#include <netinet6/ip6_var.h>
90#include <netinet/icmp6.h>
91
92#include <netinet/tcp.h>
93#include <netinet/tcp_timer.h>
94#include <netinet/tcp_var.h>
95#include <netinet/udp.h>
96#include <netinet/udp_var.h>
97#include <netinet6/tcp6_var.h>
98#include <netinet6/raw_ip6.h>
99#include <netinet6/udp6_var.h>
100#include <netinet6/pim6_var.h>
101#include <netinet6/nd6.h>
984263bc 102
984263bc
MD
103#include <netinet6/ip6protosw.h>
104
105#include <net/net_osdep.h>
106
0d16ba1d
MD
107#ifdef CARP
108#include <netinet/ip_carp.h>
109#endif
110
111
984263bc
MD
112/*
113 * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
114 */
115
116extern struct domain inet6domain;
117static struct pr_usrreqs nousrreqs;
118
119#define PR_LISTEN 0
120#define PR_ABRTACPTDIS 0
121
002c1265
MD
122struct protosw inet6sw[] = {
123 {
124 .pr_type = 0,
125 .pr_domain = &inet6domain,
126 .pr_protocol = IPPROTO_IPV6,
127 .pr_flags = 0,
128
129 .pr_init = ip6_init,
002c1265
MD
130 .pr_drain = frag6_drain,
131 .pr_usrreqs = &nousrreqs
132 },
133 {
134 .pr_type = SOCK_DGRAM,
135 .pr_domain = &inet6domain,
136 .pr_protocol = IPPROTO_UDP,
137 .pr_flags = PR_ATOMIC | PR_ADDR | PR_MPSAFE | PR_LASTHDR,
138
139 .pr_input = udp6_input,
140 .pr_output = 0,
141 .pr_ctlinput = udp6_ctlinput,
142 .pr_ctloutput = ip6_ctloutput_dispatch,
143
144 .pr_ctlport = cpu0_ctlport,
145 .pr_usrreqs = &udp6_usrreqs
146 },
147 {
148 .pr_type = SOCK_STREAM,
149 .pr_domain = &inet6domain,
150 .pr_protocol = IPPROTO_TCP,
151 .pr_flags = PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN |
96c6eb29 152 PR_MPSAFE | PR_LASTHDR | PR_ASYNC_SEND | PR_ASYNC_RCVD,
002c1265
MD
153
154 .pr_input = tcp6_input,
155 .pr_output = NULL,
156 .pr_ctlinput = tcp6_ctlinput,
157 .pr_ctloutput = tcp_ctloutput,
158
159 .pr_ctlport = cpu0_ctlport,
160#ifndef INET
161 /* don't call initialization and timeout routines twice */
162 .pr_init = tcp_init,
984263bc 163#endif
002c1265
MD
164 .pr_drain = tcp_drain,
165 .pr_usrreqs = &tcp6_usrreqs
166 },
167 {
168 .pr_type = SOCK_RAW,
169 .pr_domain = &inet6domain,
170 .pr_protocol = IPPROTO_RAW,
171 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
172
173 .pr_input = rip6_input,
174 .pr_output = rip6_output,
175 .pr_ctlinput = rip6_ctlinput,
176 .pr_ctloutput = rip6_ctloutput,
177
178 .pr_ctlport = cpu0_ctlport,
179 .pr_usrreqs = &rip6_usrreqs
180 },
181 {
182 .pr_type = SOCK_RAW,
183 .pr_domain = &inet6domain,
184 .pr_protocol = IPPROTO_ICMPV6,
185 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
186
187 .pr_input = icmp6_input,
188 .pr_output = rip6_output,
189 .pr_ctlinput = rip6_ctlinput,
190 .pr_ctloutput = rip6_ctloutput,
191
192 .pr_ctlport = cpu0_ctlport,
193 .pr_init = icmp6_init,
002c1265
MD
194 .pr_drain = NULL,
195
196 .pr_usrreqs = &rip6_usrreqs
197 },
198 {
199 .pr_type = SOCK_RAW,
200 .pr_domain = &inet6domain,
201 .pr_protocol = IPPROTO_DSTOPTS, PR_ATOMIC|PR_ADDR,
202
203 .pr_input = dest6_input,
204 .pr_output = NULL,
205 .pr_ctlinput = NULL,
206 .pr_ctloutput = NULL,
207
208 .pr_usrreqs = &nousrreqs
209 },
210 {
211 .pr_type = SOCK_RAW,
212 .pr_domain = &inet6domain,
213 .pr_protocol = IPPROTO_ROUTING, PR_ATOMIC|PR_ADDR,
214
215 .pr_input = route6_input,
216 .pr_output = NULL,
217 .pr_ctlinput = NULL,
218 .pr_ctloutput = NULL,
219
220 .pr_usrreqs = &nousrreqs
221 },
222 {
223 .pr_type = SOCK_RAW,
224 .pr_domain = &inet6domain,
225 .pr_protocol = IPPROTO_FRAGMENT, PR_ATOMIC|PR_ADDR,
226
227 .pr_input = frag6_input,
228 .pr_output = NULL,
229 .pr_ctlinput = NULL,
230 .pr_ctloutput = NULL,
231
232 .pr_usrreqs = &nousrreqs
233 },
984263bc 234#ifdef INET
002c1265
MD
235 {
236 .pr_type = SOCK_RAW,
237 .pr_domain = &inet6domain,
238 .pr_protocol = IPPROTO_IPV4,
239 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
240
241 .pr_input = encap6_input,
242 .pr_output = rip6_output,
243 .pr_ctlinput = NULL,
244 .pr_ctloutput = rip6_ctloutput,
245
246 .pr_init = encap_init,
247 .pr_usrreqs = &rip6_usrreqs
248 },
984263bc 249#endif /* INET */
002c1265
MD
250 {
251 .pr_type = SOCK_RAW,
252 .pr_domain = &inet6domain,
253 .pr_protocol = IPPROTO_IPV6,
254 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
255
256 .pr_input = encap6_input,
257 .pr_output = rip6_output,
258 .pr_ctlinput = NULL,
259 .pr_ctloutput = rip6_ctloutput,
260
261 .pr_init = encap_init,
262 .pr_usrreqs = &rip6_usrreqs
263 },
264 {
265 .pr_type = SOCK_RAW,
266 .pr_domain = &inet6domain,
267 .pr_protocol = IPPROTO_PIM,
268 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
269
270 .pr_input = pim6_input,
271 .pr_output = rip6_output,
272 .pr_ctlinput = NULL,
273 .pr_ctloutput = rip6_ctloutput,
274
275 .pr_usrreqs = &rip6_usrreqs
276 },
0d16ba1d 277#ifdef CARP
002c1265
MD
278 {
279 .pr_type = SOCK_RAW,
280 .pr_domain = &inet6domain,
281 .pr_protocol = IPPROTO_CARP,
282 .pr_flags = PR_ATOMIC|PR_ADDR,
283
24c6e413 284 .pr_input = carp6_proto_input,
002c1265
MD
285 .pr_output = rip6_output,
286 .pr_ctlinput = NULL,
287 .pr_ctloutput = rip6_ctloutput,
288
289 .pr_usrreqs = &rip6_usrreqs
290 },
0d16ba1d
MD
291#endif /* CARP */
292
002c1265
MD
293 /* raw wildcard */
294 {
295 .pr_type = SOCK_RAW,
296 .pr_domain = &inet6domain,
297 .pr_protocol = 0,
298 .pr_flags = PR_ATOMIC|PR_ADDR,
299
300 .pr_input = rip6_input,
301 .pr_output = rip6_output,
302 .pr_ctlinput = NULL,
303 .pr_ctloutput = rip6_ctloutput,
304
305 .pr_usrreqs = &rip6_usrreqs
306 },
984263bc
MD
307};
308
56d702cc 309extern int in6_inithead (void **, int);
984263bc 310
9c70fe43 311struct domain inet6domain = {
51e5cc05
SZ
312 .dom_family = AF_INET6,
313 .dom_name = "internet6",
314 .dom_init = NULL,
315 .dom_externalize = NULL,
316 .dom_dispose = NULL,
317 .dom_protosw = inet6sw,
318 .dom_protoswNPROTOSW = &inet6sw[NELEM(inet6sw)],
319 .dom_next = SLIST_ENTRY_INITIALIZER,
320 .dom_rtattach = in6_inithead,
321 .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3,
322 .dom_maxrtkey = sizeof(struct sockaddr_in6),
323 .dom_ifattach = in6_domifattach,
324 .dom_ifdetach = in6_domifdetach
9c70fe43 325};
984263bc
MD
326
327DOMAIN_SET(inet6);
328
329/*
330 * Internet configuration info
331 */
332#ifndef IPV6FORWARDING
333#ifdef GATEWAY6
334#define IPV6FORWARDING 1 /* forward IP6 packets not for us */
335#else
336#define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */
337#endif /* GATEWAY6 */
338#endif /* !IPV6FORWARDING */
339
340#ifndef IPV6_SENDREDIRECTS
341#define IPV6_SENDREDIRECTS 1
342#endif
4957d64a 343
dacc7c6d 344int nd6_onlink_ns_rfc4861 = 1; /* allow 'on-link' NS/NA (as in RFC 4861) */
984263bc
MD
345
346int ip6_forwarding = IPV6FORWARDING; /* act as router? */
347int ip6_sendredirects = IPV6_SENDREDIRECTS;
348int ip6_defhlim = IPV6_DEFHLIM;
74ceb998 349int ip6_minhlim = IPV6_MINHLIM;
984263bc
MD
350int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
351int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */
352int ip6_maxfragpackets; /* initialized in frag6.c:frag6_init() */
f2d599d1 353int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */
984263bc
MD
354int ip6_log_interval = 5;
355int ip6_hdrnestlimit = 50; /* appropriate? */
356int ip6_dad_count = 1; /* DupAddrDetectionTransmits */
357u_int32_t ip6_flow_seq;
358int ip6_auto_flowlabel = 1;
359int ip6_gif_hlim = 0;
360int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
361int ip6_rr_prune = 5; /* router renumbering prefix
1af953ac 362 * walk list every 5 sec. */
984263bc
MD
363
364u_int32_t ip6_id = 0UL;
984263bc
MD
365time_t ip6_log_time = (time_t)0L;
366
367/* icmp6 */
368/*
369 * BSDI4 defines these variables in in_proto.c...
370 * XXX: what if we don't define INET? Should we define pmtu6_expire
371 * or so? (jinmei@kame.net 19990310)
372 */
373int pmtu_expire = 60*10;
374int pmtu_probe = 60*2;
375
376/* raw IP6 parameters */
377/*
378 * Nominal space allocated to a raw ip socket.
379 */
380#define RIPV6SNDQ 8192
381#define RIPV6RCVQ 8192
382
383u_long rip6_sendspace = RIPV6SNDQ;
384u_long rip6_recvspace = RIPV6RCVQ;
385
386/* ICMPV6 parameters */
387int icmp6_rediraccept = 1; /* accept and process redirects */
388int icmp6_redirtimeout = 10 * 60; /* 10 minutes */
389int icmp6errppslim = 100; /* 100pps */
390int icmp6_nodeinfo = 3; /* enable/disable NI response */
391
392/* UDP on IP6 parameters */
393int udp6_sendspace = 9216; /* really max datagram size */
394int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
395 /* 40 1K datagrams */
396
397/*
398 * sysctl related items.
399 */
400SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0,
401 "Internet6 Family");
402
403/* net.inet6 */
404SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW, 0, "IP6");
405SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW, 0, "ICMP6");
406SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW, 0, "UDP6");
407SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW, 0, "TCP6");
984263bc
MD
408
409/* net.inet6.ip6 */
410static int
411sysctl_ip6_temppltime(SYSCTL_HANDLER_ARGS)
412{
413 int error = 0;
414 int old;
415
416 error = SYSCTL_OUT(req, arg1, sizeof(int));
417 if (error || !req->newptr)
418 return (error);
419 old = ip6_temp_preferred_lifetime;
420 error = SYSCTL_IN(req, arg1, sizeof(int));
421 if (ip6_temp_preferred_lifetime <
422 ip6_desync_factor + ip6_temp_regen_advance) {
423 ip6_temp_preferred_lifetime = old;
bde3511a 424 return (EINVAL);
984263bc 425 }
bde3511a 426 return (error);
984263bc
MD
427}
428
429static int
430sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS)
431{
432 int error = 0;
433 int old;
434
435 error = SYSCTL_OUT(req, arg1, sizeof(int));
436 if (error || !req->newptr)
437 return (error);
438 old = ip6_temp_valid_lifetime;
439 error = SYSCTL_IN(req, arg1, sizeof(int));
440 if (ip6_temp_valid_lifetime < ip6_temp_preferred_lifetime) {
441 ip6_temp_preferred_lifetime = old;
bde3511a 442 return (EINVAL);
984263bc 443 }
bde3511a 444 return (error);
984263bc
MD
445}
446
5b8dbdac
SG
447SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_RW,
448 &ip6_forwarding, 0, "Enable IP forwarding between interfaces");
449SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, CTLFLAG_RW,
450 &ip6_sendredirects, 0, "Enable sending IP redirects");
984263bc 451SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM,
5b8dbdac 452 hlim, CTLFLAG_RW, &ip6_defhlim, 0, "Default hop limit");
74ceb998
MD
453SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MINHLIM,
454 minhlim, CTLFLAG_RW, &ip6_minhlim, 0, "Default hop limit");
984263bc 455SYSCTL_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RD,
5b8dbdac
SG
456 &ip6stat, ip6stat, "IP stats");
457SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets,
458 CTLFLAG_RW, &ip6_maxfragpackets, 0, "Maximum packets in reassembly queue");
459SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv,
460 CTLFLAG_RW, &ip6_accept_rtadv, 0, "Acts as a host not a router");
984263bc
MD
461SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL,
462 log_interval, CTLFLAG_RW, &ip6_log_interval, 0, "");
5b8dbdac
SG
463SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, CTLFLAG_RW,
464 &ip6_hdrnestlimit, 0, "Upper limit of # of extension headers");
465SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, CTLFLAG_RW,
466 &ip6_dad_count, 0, "Number of times to perform duplicate address detectione");
467SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL, auto_flowlabel, CTLFLAG_RW,
468 &ip6_auto_flowlabel, 0, "Enable attaching flowlabel automatically");
469SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim, CTLFLAG_RW,
470 &ip6_defmcasthlim, 0, "Default multicast hop limit");
471SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW,
472 &ip6_gif_hlim, 0, "Hop limit for gif encap packet");
984263bc 473SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION,
5b8dbdac
SG
474 kame_version, CTLFLAG_RD, __KAME_VERSION, 0, "Kame version");
475SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED, use_deprecated, CTLFLAG_RW,
476 &ip6_use_deprecated, 0, "Allow deprecated addr as source");
984263bc 477SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE,
5b8dbdac
SG
478 rr_prune, CTLFLAG_RW, &ip6_rr_prune, 0,
479 "Walk timer for router renumbering");
480SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USETEMPADDR, use_tempaddr, CTLFLAG_RW,
481 &ip6_use_tempaddr, 0, "Whether to use temporary addresses");
984263bc 482SYSCTL_OID(_net_inet6_ip6, IPV6CTL_TEMPPLTIME, temppltime,
5b8dbdac
SG
483 CTLTYPE_INT|CTLFLAG_RW, &ip6_temp_preferred_lifetime, 0,
484 sysctl_ip6_temppltime, "I",
485 "Preferred lifetime for tmpaddrs");
984263bc 486SYSCTL_OID(_net_inet6_ip6, IPV6CTL_TEMPVLTIME, tempvltime,
5b8dbdac
SG
487 CTLTYPE_INT|CTLFLAG_RW, &ip6_temp_valid_lifetime, 0,
488 sysctl_ip6_tempvltime, "I",
489 "Valid lifetime for tmpaddrs");
5b8dbdac
SG
490SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal, CTLFLAG_RW,
491 &ip6_auto_linklocal, 0, "Enable auto-assigning a link-local address");
984263bc 492SYSCTL_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RD,
5b8dbdac 493 &rip6stat, rip6stat, "Raw stats");
f2d599d1
SZ
494SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, CTLFLAG_RW,
495 &ip6_maxfrags, 0, "Maximum fragments in reassembly queues");
984263bc
MD
496
497/* net.inet6.icmp6 */
5b8dbdac
SG
498SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, CTLFLAG_RW,
499 &icmp6_rediraccept, 0, "If enabled, accept and process redirects");
500SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, CTLFLAG_RW,
501 &icmp6_redirtimeout, 0, "Cache time for redirect routes");
984263bc 502SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD,
5b8dbdac
SG
503 &icmp6stat, icmp6stat, "Stats");
504SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW,
505 &nd6_prune, 0, "Prune interval");
506SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, CTLFLAG_RW,
507 &nd6_delay, 0, "Reachability timeout for stale neighbors");
508SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES, nd6_umaxtries, CTLFLAG_RW,
509 &nd6_umaxtries, 0, "Maximum unicast query");
510SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES, nd6_mmaxtries, CTLFLAG_RW,
511 &nd6_mmaxtries, 0, "Maximum multicast query");
512SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK, nd6_useloopback, CTLFLAG_RW,
513 &nd6_useloopback, 0, "Use loopback interface for local traffic");
984263bc 514SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO,
5b8dbdac 515 nodeinfo, CTLFLAG_RW, &icmp6_nodeinfo, 0, "Enable/disable NI response");
984263bc 516SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT,
5b8dbdac
SG
517 errppslimit, CTLFLAG_RW, &icmp6errppslim, 0,
518 "ICMPv6 error maximum packet-per-second value (default: 100pps)");
519SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, CTLFLAG_RW,
520 &nd6_maxnudhint, 0, "Max # of subsequent upper layer hints");
521SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG, nd6_debug, CTLFLAG_RW,
522 &nd6_debug, 0, "Enable debug output");
f5164be2 523SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861, nd6_onlink_ns_rfc4861, CTLFLAG_RW,
4957d64a 524 &nd6_onlink_ns_rfc4861, 0, "Accept 'on-link' NS/NA in compliance with RFC 4861.");