Home | History | Annotate | Download | only in netinet
History log of /src/sys/netinet/icmp6.h
RevisionDateAuthorComments
 1.61  06-Dec-2024  riastradh netinet/icmp6.h: Nix trailing whitespace.

No functional change intended.
 1.60  06-Dec-2024  riastradh netinet/icmp6.h: Need sys/types.h and netinet/in.h.

- sys/types.h for u_intN_t
- netinet/in.h for struct in6_addr
 1.59  29-Aug-2022  knakahara branches: 1.59.10;
Add sysctl entry to control to send routing message for RTM_DYNAMIC.

Some routing daemons require such routing message to keep coherency.

If we want to let kernel send such message, set net.inet.icmp.dynamic_rt_msg=1
for IPv4, net.inet6.icmp6.dynamic_rt_msg=1 for IPv6.
Default(=0) is the same as before, that is, not send such routing message.
 1.58  22-Aug-2022  knakahara Add sysctl entry to enable/disable to use path MTU discovery for icmpv6 reflecting.

If we want to use path MTU discovery for icmp reflecting set
net.inet6.icmp6.reflect_pmtu=1. Default(=0) is the same as before, that is,
use IPV6_MINMTU.
 1.57  27-Jul-2020  roy icmp6: Remove __packed attribute from icmp6 structures

They should naturally align.
Add compile time assertations to icmp6.c to prove this.
 1.56  15-Jun-2020  roy icmp6.h: #define ND_RA_FLAG_PROXY

RFC 4389, experimental. Maybe someone will implement it one day.
 1.55  15-Jun-2020  roy icmp6.h: #define ND_OPT_PI_FLAG_ROUTER

We already define ND_RA_FLAG_HOME_AGENT and that kind of requires
ND_OPT_PI_FLAG_ROUTER.
 1.54  12-Jun-2020  roy Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).
 1.53  09-Mar-2020  roy route: RTM_MISS now puts the message source address in RTA_AUTHOR

route(8) also reports this.
A userland app could use this to blacklist nodes who probe for machines
that doesn't exist on a subnet / prefix.
 1.52  22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.51  24-Apr-2018  maxv branches: 1.51.2;
Add code 3 of paramprob, part of RFC7112: "IPv6 First Fragment has
incomplete IPv6 Header Chain". Handle this code in ping6.
 1.50  06-Mar-2018  roy nd6: add a nonce to DaD probes in-case they are looped back to us

This implements RFC 7527, based a similar change in FreeBSD.
 1.49  23-Jan-2018  maxv branches: 1.49.2;
Style, localify, remove XXX when there's no issue, and switch 'extra'
to int.
 1.48  11-Dec-2016  ozaki-r Remove unnecessary forward struct declarations
 1.47  01-Jul-2013  christos branches: 1.47.8; 1.47.12;
Add MLD_LISTENER_REDUCTION per RFC 3542. Requested by Lorenzo Colitti.
 1.46  19-Jul-2012  spz branches: 1.46.2; 1.46.4;
<grmbl>whitespace</grmbl>
 1.45  19-Jul-2012  spz this commit contains two sets of unrelated changes:
"while I was here" I checked other KAME implementations for their icmp6.h
version, and thus:
- added a define for MLDV2_LISTENER_REPORT from FreeBSD
- added defines for the missing ICMP6_DST_UNREACH codes

then on to what I actually wanted to do:
- adds strings for the types and codes (encapsulated by ICMP6_STRINGS)
for the use of npfctl and other tools that might want to parse
human-friendly names instead of the corresponding number for ipv6-icmp
types and codes.
The strings are ordered such that their index is (as far as is practical)
the number belonging to the name, which is why there are
icmp6_type_err (use directly) and icmp6_type_info (add 128)
 1.44  10-Dec-2011  roy branches: 1.44.2;
Add RDNSS and DNSSL support, RFC6106.
Replace custom lists with TAILQ lists.
Clean up plently of signed vs unsigned warnings and set WARNS=4.

Adapted from FreeBSD.
 1.43  11-Nov-2011  gdt branches: 1.43.4;
Move RTF_ANNOUNCE flag so that it no longer conflicts with RTF_PROTO2.

RTF_ANNOUNCE was defined as RTF_PROTO2. The flag is used to indicated
that host should act as a proxy for a link level arp or ndp request.
(If RTF_PROTO2 is used as an experimental flag (as advertised),
various problems can occur.)

This commit provides a first-class definition with its own bit for
RTF_ANNOUNCE, removes the old aliasing definitions, and adds support
for the new RTF_ANNOUNCE flag to netstat(8) and route(8).,

Also, remove unused RTF_ flags that collide with RTF_PROTO1:
netinet/icmp6.h defined RTF_PROBEMTU as RTF_PROTO1
netinet/if_inarp.h defined RTF_USETRAILERS as RTF_PROTO1
(Neither of these flags are used anywhere. Both have been removed
to reduce chances of collision with RTF_PROTO1.)

Figuring this out and the diff are the work of Beverly Schwartz of
BBN.

(Passed release build, boot in VM, with no apparently related atf
failures.)

Approved for Public Release, Distribution Unlimited
This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.
 1.42  24-May-2011  spz branches: 1.42.4;
RA flood mitigation via a limit on accepted routes:
- introduce a limit for the routes accepted via IPv6 Router Advertisement:
a common 2 interface client will have 6, the default limit is 100 and
can be adjusted via sysctl
- report the current number of routes installed via RA via sysctl
- count discarded route additions. Note that one RA message is two routes.
This is at present only across all interfaces even though per-interface
would be more useful, since the per-interface structure complies to RFC2466
- bump kernel version due to the previous change
- adjust netstat to use the new value (with netstat -p icmp6)
 1.41  08-May-2011  spz update (unused) ND option identifiers and corresponding comments
 1.40  31-Oct-2009  christos branches: 1.40.4; 1.40.6;
add enough info to let rtadvd compile with route-info.
 1.39  11-Jul-2008  cyber Add IANA allocation and header for RFC 5006 (RA RDNSS) IPv6 Router
Advertisement option.
 1.38  15-Apr-2008  thorpej branches: 1.38.4; 1.38.6; 1.38.8; 1.38.10;
Make ip6 and icmp6 stats per-cpu.
 1.37  08-Apr-2008  thorpej Change ICMP6 stats from a structure to an array of uint64_t's.

Note: This is ABI-compatible with the old icmp6stat structure; old netstat
binaries will continue to work properly.
 1.36  25-Dec-2007  perry branches: 1.36.2; 1.36.6;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.35  07-Mar-2006  wiz branches: 1.35.36; 1.35.42; 1.35.46; 1.35.50;
'advertisment' -> 'advertisement', from leonardo chiquitto filho
via jmc@openbsd.
 1.34  05-Mar-2006  rpaulo branches: 1.34.2;
NDP-related improvements:
RFC4191
- supports host-side router-preference

RFC3542
- if DAD fails on a interface, disables IPv6 operation on the
interface
- don't advertise MLD report before DAD finishes

Others
- fixes integer overflow for valid and preferred lifetimes
- improves timer granularity for MLD, using callout-timer.
- reflects rtadvd's IPv6 host variable information into kernel
(router only)
- adds a sysctl option to enable/disable pMTUd for multicast
packets
- performs NUD on PPP/GRE interface by default
- Redirect works regardless of ip6_accept_rtadv
- removes RFC1885-related code

From the KAME project via SUZUKI Shinsuke.
Reviewed by core.
 1.33  21-Jan-2006  rpaulo branches: 1.33.2; 1.33.4; 1.33.6;
Better support of IPv6 scoped addresses.

- most of the kernel code will not care about the actual encoding of
scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
scoped addresses as a special case.
- scope boundary check will be stricter. For example, the current
*BSD code allows a packet with src=::1 and dst=(some global IPv6
address) to be sent outside of the node, if the application do:
s = socket(AF_INET6);
bind(s, "::1");
sendto(s, some_global_IPv6_addr);
This is clearly wrong, since ::1 is only meaningful within a single
node, but the current implementation of the *BSD kernel cannot
reject this attempt.
- and, while there, don't try to remove the ff02::/32 interface route
entry in in6_ifdetach() as it's already gone.

This also includes some level of support for the standard source
address selection algorithm defined in RFC3484, which will be
completed on in the future.

From the KAME project via JINMEI Tatuya.
Approved by core@.
 1.32  10-Dec-2005  elad branches: 1.32.2;
Multiple inclusion protection, as suggested by christos@ on tech-kern@
few days ago.
 1.31  29-May-2005  christos branches: 1.31.2;
remove stupid hand-rolled loop and kernel conditional.
 1.30  21-Apr-2004  itojun no space between function name and paren: foo (blah) -> foo(blah)
 1.29  18-Apr-2004  matt De __P()
 1.28  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.27  06-Jun-2003  itojun branches: 1.27.2;
separate RFC2292 decls for MLD; sync w/ kame
 1.26  06-Jun-2003  itojun - sync up MLD declaration with RFC3542 (s/MLD6/MLD/)
- routing header declaration with RFC3542
(note: sizeof(ip6_rthdr0) has changed!)
also, sync up with RFC2460 routing header definition (no "strict" source
routing mode any more)

part of advanced API update (RFC2292 -> 3542).
 1.25  02-Nov-2002  perry /*CONTCOND*/ while (0)'ed macros
 1.24  09-Jun-2002  itojun whitespace
 1.23  08-Jun-2002  itojun sync with latest KAME in6_ifaddr/prefix/default router manipulation.
behavior changes:
- two iocts used by ndp(8) are now obsolete (backward compat provided).
use sysctl path instead.
- lo0 does not get ::1 automatically. it will get ::1 when lo0 comes up.
 1.22  29-May-2002  itojun move per-interface ip6/icmp6 stat to ifnet->if_afdata. sync w/kame
 1.21  21-Dec-2001  itojun branches: 1.21.8;
have packed attribute to protocol structs. sync with kame
 1.20  07-Dec-2001  itojun correct timing to increment icmp6 MIB variables. sync with kame
 1.19  07-Feb-2001  itojun branches: 1.19.2; 1.19.4;
during ip6/icmp6 inbound packet processing, do not call log() nor printf() in
normal operation (/var can get filled up by flodding bogus packets).
sysctl net.inet6.icmp6.nd6_debug will turn on diagnostic messages.
(#define ND6_DEBUG will turn it on by default)

improve stats in ND6 code.

lots of synchronziation with kame (including comments and cometic ones).
 1.18  22-Jan-2001  itojun fix RR result bit in little endian systems. sync with kame
 1.17  21-Jan-2001  itojun sync with latest kame.
- make icmp6.h spec conformant to 2292bis-02, regarding to router reumbering
flag bit.
- latest rtadvd.
 1.16  09-Dec-2000  itojun update icmp6 too big validation. the change is necessary since pmtud is
mandatory for IPv6 (so we can't just validate by using connected pcb - we need
to allow traffic from unconnected pcb to do pmtud).
- if the traffic is validated by xx_ctlinput, allow up to "hiwat" pmtud
route entries.
- if the traffic was not validated by xx_ctlinput, allow up to "lowat" pmtud
route entries (there's upper limit, so bad guys cannot blow up our routing
table).
sync with kame

XXX need to think again about default hiwat/lowat value.
XXX victim selection to help starvation case
 1.15  18-Oct-2000  itojun verify ICMPv6 too big messages based on TCP pcbs, and/or IPsec SA.
TODO: udp6, and sendto consideration. as pmtud is mandatory for IPv6,
it is rather important for us to support those cases.
TODO: more testing
TODO: kame sync
 1.14  10-Oct-2000  itojun sync with kame ($KAME$)
 1.13  03-Aug-2000  itojun clearifications in icmp6 node query support.
XXX previous commit included "supported qtypes" icmp6 node query support.
sorry commit message was mistaken.
 1.12  03-Aug-2000  itojun correct typo in #define. ICMP6_NI_SUCESS -> SUCCESS (notice missing C).
sync with kame.
 1.11  28-Jul-2000  itojun nuke the following sysctl variables. "ppsratelimit" should work better.
need to recompile sbin/sysctl after updating /usr/include.
net.inet.tcp.rstratelimit
net.inet.icmp.errratelimit
net.inet6.icmp6.errratelimit
 1.10  06-Jul-2000  itojun - do not use bitfield for router renumbering header.
- add protection mechanism against ND cache corruption due to bad NUD hints.
- more stats
- icmp6 pps limitation. TOOD: should implement ppsratecheck(9).
 1.9  12-Jun-2000  itojun branches: 1.9.2;
better conformance to draft-ietf-ipngwg-icmp-name-lookups-05.
the old code was chimera of 03 and 05 draft.

-n by default, since IPv6 reverse lookup takes too much time.
use -H to enable reverse name lookup.
 1.8  09-Mar-2000  itojun branches: 1.8.2;
change member name for icmp6_filter, to be conformant to RFC2292.
From: Francis Dupont
 1.7  28-Feb-2000  itojun support draft-ietf-ipngwg-icmp-name-lookups-05.txt, drop support for
draft-ietf-ipngwg-icmp-name-lookups-04.txt.

There are certain bitfield change in 04 draft to 05 draft, which makes
04 "ping6 -a" and 05 "ping6 -a" not interoperable. sigh.
 1.6  28-Feb-2000  itojun remove some of cross-BSD portability #ifdef.
remove xxCTL_VARS, which is BSDI specific.
 1.5  26-Feb-2000  itojun bring in recent KAME changes (only important and stable ones, as usual).
- remove net.inet6.ip6.nd6_proxyall. introduce proxy NDP code works
just like "arp -s".
- revise source address selection.
be more careful about use of yet-to-be-valid addresses as source.
- as router, transmit ICMP6_DST_UNREACH_BEYONDSCOPE against out-of-scope
packet forwarding attempt.
- path MTU discovery takes care of routing header properly.
- be more strict about mbuf chain parsing.
 1.4  06-Feb-2000  itojun to be more rfc2292 complient, move ip6.h and icmp6.h into netinet.
(netinet6/{ip6,icmp6}.h is non-standard path - these files should go away)

it was not possible to use cvsmove in this case.
when you try to look at history, chase it toward netinet6/{ip6,icmp6}.h.
 1.3  03-Jul-1999  thorpej branches: 1.3.2;
RCS ID police.
 1.2  01-Jul-1999  itojun branches: 1.2.2;
IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.
 1.1  28-Jun-1999  itojun branches: 1.1.2;
file icmp6.h was initially added on branch kame.
 1.1.2.1  28-Jun-1999  itojun KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce. this may not compile
due to multiple reasons.
 1.2.2.3  02-Aug-1999  thorpej Update from trunk.
 1.2.2.2  01-Jul-1999  thorpej Sync w/ -current.
 1.2.2.1  01-Jul-1999  thorpej file icmp6.h was added on branch chs-ubc2 on 1999-07-01 23:47:00 +0000
 1.3.2.3  11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.2  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.3.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.8.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.4  16-Aug-2000  itojun pullup (approved by releng-1-5)

switch from net.inet*.*.*ratelimit to net.inet*.*.ppslimit.

(tags are rough estimate - we had some try-and-error in main trunc)
sys/netinet/icmp6.h 1.9 -> 1.11
sys/netinet/icmp_var.h 1.15 -> 1.17
sys/netinet/in_proto.c 1.39 -> 1.42
sys/netinet/ip_icmp.c 1.50 -> 1.51, 1.52 -> 1.54
sys/netinet/tcp_input.c 1.111 -> 1.112, 1.115 -> 1.117
sys/netinet/tcp_usrreq.c 1.52 -> 1.53
sys/netinet/tcp_var.h 1.72 -> 1.75
sys/netinet6/icmp6.c 1.34 -> 1.35, 1.36 -> 1.38
sys/netinet6/in6_proto.c 1.17 -> 1.19
 1.9.2.3  04-Aug-2000  itojun pullup (approved by releng-1-5)
sys/netinet6/icmp6.h 1.11 -> 1.13
sys/netinet6/icmp6.c 1.39 -> 1.41

cvs rdiff -r1.11 -r1.12 syssrc/sys/netinet/icmp6.h
cvs rdiff -r1.39 -r1.40 syssrc/sys/netinet6/icmp6.c

correct typo in #define. ICMP6_NI_SUCESS -> SUCCESS (notice missing C).
sync with kame.

cvs rdiff -r1.12 -r1.13 syssrc/sys/netinet/icmp6.h
cvs rdiff -r1.40 -r1.41 syssrc/sys/netinet6/icmp6.c

clearifications in icmp6 node query support.
XXX previous commit included "supported qtypes" icmp6 node query support.
sorry commit message was mistaken.
 1.9.2.2  20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
- do not use bitfield for router renumbering header.
part of sys/netinet/icmp6.h 1.9 -> 1.10
 1.9.2.1  20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
- add protection mechanism against ND cache corruption due to bad NUD hints.

this is part of:
sys/netinet/icmp6.h 1.9 -> 1.10
sys/netinet/tcp_input.c 1.111 -> 1.112
sys/netinet6/icmp6.c 1.34 -> 1.35
sys/netinet6/nd6.c 1.30 -> 1.31
sys/netinet6/nd6.h 1.14 -> 1.15
 1.19.4.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.2.3  11-Nov-2002  nathanw Catch up to -current
 1.19.2.2  20-Jun-2002  nathanw Catch up to -current.
 1.19.2.1  08-Jan-2002  nathanw Catch up to -current.
 1.21.8.2  20-Jun-2002  gehenna catch up with -current.
 1.21.8.1  30-May-2002  gehenna Catch up with -current.
 1.27.2.5  11-Dec-2005  christos Sync with head.
 1.27.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.27.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.27.2.1  03-Aug-2004  skrll Sync with HEAD
 1.31.2.2  21-Jan-2008  yamt sync with head
 1.31.2.1  21-Jun-2006  yamt sync with head.
 1.32.2.1  01-Feb-2006  yamt sync with head.
 1.33.6.1  13-Mar-2006  yamt sync with head.
 1.33.4.1  22-Apr-2006  simonb Sync with head.
 1.33.2.1  09-Sep-2006  rpaulo sync with head
 1.34.2.1  19-Apr-2006  elad sync with head.
 1.35.50.1  02-Jan-2008  bouyer Sync with HEAD
 1.35.46.1  26-Dec-2007  ad Sync with head.
 1.35.42.1  18-Feb-2008  mjf Sync with HEAD.
 1.35.36.1  09-Jan-2008  matt sync with HEAD
 1.36.6.2  28-Sep-2008  mjf Sync with HEAD.
 1.36.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.36.2.1  22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.38.10.1  19-Oct-2008  haad Sync with HEAD.
 1.38.8.1  18-Jul-2008  simonb Sync with head.
 1.38.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.38.4.2  11-Mar-2010  yamt sync with head
 1.38.4.1  04-May-2009  yamt sync with head.
 1.40.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.40.4.1  31-May-2011  rmind sync with head
 1.42.4.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.42.4.2  30-Oct-2012  yamt sync with head
 1.42.4.1  17-Apr-2012  yamt sync with head
 1.43.4.1  18-Feb-2012  mrg merge to -current.
 1.44.2.1  25-Jul-2012  jdc Pull up revisions:
src/sys/netinet/icmp6.h revisions 1.45,1.46
(requested by rmind in ticket #434).

this commit contains two sets of unrelated changes:
"while I was here" I checked other KAME implementations for their icmp6.h
version, and thus:
- added a define for MLDV2_LISTENER_REPORT from FreeBSD
- added defines for the missing ICMP6_DST_UNREACH codes

then on to what I actually wanted to do:
- adds strings for the types and codes (encapsulated by ICMP6_STRINGS)
for the use of npfctl and other tools that might want to parse
human-friendly names instead of the corresponding number for ipv6-icmp
types and codes.
The strings are ordered such that their index is (as far as is practical)
the number belonging to the name, which is why there are
icmp6_type_err (use directly) and icmp6_type_info (add 128)

<grmbl>whitespace</grmbl>
 1.46.4.1  28-Aug-2013  rmind sync with head
 1.46.2.2  03-Dec-2017  jdolecek update from HEAD
 1.46.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.12.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.47.8.1  05-Feb-2017  skrll Sync with HEAD
 1.49.2.3  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.49.2.2  02-May-2018  pgoyette Synch with HEAD
 1.49.2.1  15-Mar-2018  pgoyette Synch with HEAD
 1.51.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.51.2.1  10-Jun-2019  christos Sync with HEAD
 1.59.10.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed