Home | History | Annotate | only in /src/usr.sbin/rtadvd
History log of /src/usr.sbin/rtadvd
RevisionDateAuthorComments
 1.27 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.26 03-Feb-2021  roy rtadvd: no longer need packed member warning
 1.25 06-Sep-2020  mrg add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
 1.24 21-Apr-2020  roy rtadvd: Remove router renumbering - it's been disable for years
 1.23 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.22 11-Jan-2019  christos use expandm from libwrap.
 1.21 10-Oct-2017  christos branches: 1.21.2; 1.21.4;
use librumpres
 1.20 11-Jan-2017  joerg Disable a couple of warnings until further investigation.
 1.19 15-Jun-2016  riastradh branches: 1.19.2;
No more obvious strict aliasing violations here.
 1.18 11-Nov-2015  ozaki-r Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.17 10-Aug-2012  joerg Remove many HAVE_GCC || HAVE_PCC conditionals as the options also apply
to Clang. Add a few cases of HAVE_LLVM for -fno-strict-aliasing.
 1.16 10-Dec-2011  roy 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.15 20-Jun-2011  mrg branches: 1.15.2;
remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
 1.14 31-Oct-2009  christos branches: 1.14.4;
add -DROUTEINFO
 1.13 22-Apr-2009  lukem Enable WARNS=4 by default, except for:
cpuctl dumplfs hprop ipf iprop-log kadmin kcm kdc kdigest
kimpersonate kstash ktutil makefs ndbootd ntp pppd quot
racoon racoonctl rtadvd sntp sup tcpdchk tcpdmatch tcpdump
traceroute traceroute6 user veriexecgen wsmoused zic
(Mostly third-party applications)
 1.12 29-Aug-2008  gmcgarry branches: 1.12.6;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.
 1.11 28-May-2007  tls branches: 1.11.12;
Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
 1.10 11-May-2006  mrg u_char -> char for several things:
- inet_ntop()
- if_indextoname()
- variable assignment matching
char -> u_char in one place for variable assignment matching
 1.9 11-May-2006  mrg use -fno-strict-aliasing for dump.c with GCC4
 1.8 25-Feb-2006  simonb libcompat isn't needed any more here.
 1.7 21-May-2002  itojun use pidfile(3). sync w/kame
 1.6 15-May-2001  kleink Need <bsd.own.mk> now.
 1.5 15-May-2001  kleink Don't install the example config if MKSHARE=no.
 1.4 21-Jan-2001  itojun make it clearer that /etc/rtadvd.conf is optional (normally,
configurations were derived from kernel interface settings).

install rtadvd.conf into /usr/share/exapmles/rtadvd, instead of /etc.

sync with kame.
 1.3 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 03-Jul-1999  itojun s/CFLAGS/CPPFLAGS/ for -D and -I.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.11.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.12.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.14.4.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.15.2.2 30-Oct-2012  yamt sync with head
 1.15.2.1 17-Apr-2012  yamt sync with head
 1.19.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.21.4.3 21-Apr-2020  martin Sync with HEAD
 1.21.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.21.4.1 10-Jun-2019  christos Sync with HEAD
 1.21.2.1 18-Jan-2019  pgoyette Synch with HEAD
 1.19 23-Mar-2021  christos print function names as %s: not <%s> everywhere for consistency.
 1.18 03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.17 06-Nov-2017  christos branches: 1.17.4;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.16 11-Nov-2015  ozaki-r branches: 1.16.8;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.15 05-Jun-2015  roy Use %m in syslog(3) instead of %s strerror(3).
 1.14 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.13 10-Dec-2011  roy branches: 1.13.6;
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.12 18-Mar-2006  dan branches: 1.12.42;
actually toggle the value of dquote when seeing a '"', as I intuit the
author must have intended. Found via coverity CID 579.
 1.11 05-Mar-2006  rpaulo 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.10 30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.8 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.7 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.6 04-Feb-2001  itojun avoid infinite loop when -s is specified (select loop mistake).
make agetent() 32bit clean. KAME PR 127.
disable -R (router renumbering receiver). sync with kame.
 1.5 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.4 13-Mar-2000  itojun bring in latest kame tree. this fixes unclosed file descdriptor
in router renumbering case.
 1.3 08-Dec-1999  itojun netbsd rcsid fix.
 1.2 06-Jul-1999  itojun branches: 1.2.4;
fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.2.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.12.42.1 17-Apr-2012  yamt sync with head
 1.13.6.1 25-Feb-2013  tls resync with head
 1.16.8.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.17.4.1 10-Jun-2019  christos Sync with HEAD
 1.7 10-Dec-2011  roy 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.6 05-Mar-2006  rpaulo branches: 1.6.42;
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.5 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.4 04-Feb-2001  itojun avoid infinite loop when -s is specified (select loop mistake).
make agetent() 32bit clean. KAME PR 127.
disable -R (router renumbering receiver). sync with kame.
 1.3 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.6.42.1 17-Apr-2012  yamt sync with head
 1.47 27-Nov-2021  rillig usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it

Since 2021-01-31, lint no longer requires a CONSTCOND comment in a
do-while-0 statement since this is a common code pattern, especially in
statement-like macros.

sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch]
 1.46 23-Mar-2021  christos print function names as %s: not <%s> everywhere for consistency.
 1.45 22-Mar-2021  christos - remove extra \n from stderr logging
- add string message types
- sprinkle const
 1.44 21-Apr-2020  roy rtadvd: Remove disabled use of SIOCGIFPREFIX_IN6

It's not been enabled since the functionality was added to ifconfig(8)
many many years ago.
 1.43 11-Nov-2019  roy rtadvd: Add C flag to control the zeroing of the leaving configuration

This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.42 10-Nov-2019  roy rtadvd: remove support for SIOCSIFINFO_IN6

It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.
 1.41 14-Jun-2019  roy branches: 1.41.2;
rtadvd: fix rdnss and dnssl lifetime assignment

Treat it the same as a prefix valid time as per the RFC.
This allows to set a zero value to remove the assignment from the node.
 1.40 20-Apr-2018  roy branches: 1.40.2;
Unicast solicited RA's as per RFC 7772.

This is done by having a secondary timer against rainfo so we
can delay unicasting by the required randomised amount of time
without affecting the unsolicited RA timer.
 1.39 20-Apr-2018  roy Ensure that the soliciter list is initialised and freed correctly, even if it's not used yet.
 1.38 20-Apr-2018  roy White space police.
 1.37 06-Nov-2017  christos branches: 1.37.2;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.36 27-Feb-2017  ozaki-r branches: 1.36.4;
Fix the default value of rltime

According to rtadvd.conf(5), the default value of rltime is 1800 seconds.

PR bin/51994
 1.35 11-Nov-2015  ozaki-r branches: 1.35.2; 1.35.4;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.34 05-Jun-2015  roy Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.33 24-Jan-2013  christos branches: 1.33.8; 1.33.10; 1.33.14;
fix previous.
 1.32 24-Jan-2013  christos make it static const
 1.31 14-Dec-2012  roy Intsead of forcing out each RA at shutdown and sleeping we now use
the existing timer model and wait for each RA to expire itself after
sending the required number of transmissions.

This allows for a faster and saner shutdown.
 1.30 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.29 11-Dec-2012  roy Add support for the noifprefix keyword which stops rtadvd(8) gathing prefix
information from the interface if no addrs are present in rtadvd.conf(5).
 1.28 08-Aug-2012  msaitoh branches: 1.28.2;
Fix a bug that incorrect RA packet is sent if rtadvd.conf exists.
Fixes PR#46580 reported by Takahiro HAYASHI.
 1.27 11-Dec-2011  christos branches: 1.27.2;
- sprinkle const
- malloc + memset -> calloc
- free + malloc -> realloc
- syslog("%s", strerror(errno)) -> syslog("%m")
 1.26 10-Dec-2011  roy 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.25 11-May-2006  mrg branches: 1.25.16; 1.25.42;
u_char -> char for several things:
- inet_ntop()
- if_indextoname()
- variable assignment matching
char -> u_char in one place for variable assignment matching
 1.24 10-May-2006  rpaulo PR 33462: default maxinterval was not being initialized properly.
From Matthias Scheller.

From KAME sources.
 1.23 22-Mar-2006  itojun avoid heap overrun. thanks goes to Susan Lan of zyxel.
 1.22 05-Mar-2006  rpaulo 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.21 17-Jun-2003  itojun relax addrs#x config parameter. should address PR 21872
 1.20 17-May-2003  itojun strncpy -> strlcpy
 1.19 10-Jul-2002  itojun test malloc failure. From: Chad Loder <cloder@acm.org>. sync w/kame
 1.18 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.17 15-Jun-2002  matt Remove extra/redundant argument to syslog.
 1.16 09-Jun-2002  itojun use strchr
 1.15 08-Jun-2002  itojun do not use deprecated ioctls
 1.14 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.13 03-Jun-2001  itojun prevent overflow of lifetime value. sync with kame
 1.12 05-Feb-2001  itojun typo. ntohl -> htonl.
 1.11 04-Feb-2001  itojun avoid infinite loop when -s is specified (select loop mistake).
make agetent() 32bit clean. KAME PR 127.
disable -R (router renumbering receiver). sync with kame.
 1.10 23-Jan-2001  itojun make sure to initialize prefix information struct before use. sync with kame
 1.9 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.8 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.7 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.6 13-Mar-2000  itojun bring in latest kame tree. this fixes unclosed file descdriptor
in router renumbering case.
 1.5 06-Feb-2000  itojun fix include file path (IPv6 related).
 1.4 02-Feb-2000  itojun add -R (accept router renumbering packet). now router renumbering is disabled
by default for ipsec config twists.
dies gracefully on SIGTERM.
 1.3 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.2 04-Jul-1999  itojun more careful signed-ness handling in parsing config file.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.25.42.5 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.25.42.4 23-Jan-2013  yamt sync with head
 1.25.42.3 16-Jan-2013  yamt sync with (a bit old) head
 1.25.42.2 30-Oct-2012  yamt sync with head
 1.25.42.1 17-Apr-2012  yamt sync with head
 1.25.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.27.2.2 14-Jul-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1440):
usr.sbin/rtadvd/rtadvd.h: revision 1.15
usr.sbin/rtadvd/config.c: revision 1.36
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.27.2.1 08-Aug-2012  martin branches: 1.27.2.1.4; 1.27.2.1.6;
Pull up following revision(s) (requested by msaitoh in ticket #465):
usr.sbin/rtadvd/config.c: revision 1.28
Fix a bug that incorrect RA packet is sent if rtadvd.conf exists.
Fixes PR#46580 reported by Takahiro HAYASHI.
 1.27.2.1.6.1 14-Jul-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1440):
usr.sbin/rtadvd/rtadvd.h: revision 1.15
usr.sbin/rtadvd/config.c: revision 1.36
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.27.2.1.4.1 14-Jul-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1440):
usr.sbin/rtadvd/rtadvd.h: revision 1.15
usr.sbin/rtadvd/config.c: revision 1.36
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.28.2.1 25-Feb-2013  tls resync with head
 1.33.14.1 12-May-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1373):
usr.sbin/rtadvd/config.c: revision 1.36
usr.sbin/rtadvd/rtadvd.h: revision 1.15
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.33.10.1 12-May-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1373):
usr.sbin/rtadvd/config.c: revision 1.36
usr.sbin/rtadvd/rtadvd.h: revision 1.15
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.33.8.1 12-May-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1373):
usr.sbin/rtadvd/config.c: revision 1.36
usr.sbin/rtadvd/rtadvd.h: revision 1.15
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.35.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.35.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.36.4.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.37.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.40.2.2 21-Apr-2020  martin Sync with HEAD
 1.40.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.41.2.1 11-Nov-2019  martin Pull up following revision(s) (requested by roy in ticket #417):

usr.sbin/rtadvd/rtadvd.c: revision 1.70
usr.sbin/rtadvd/rtadvd.c: revision 1.71
usr.sbin/rtadvd/rtadvd.h: revision 1.20
usr.sbin/rtadvd/config.c: revision 1.42
usr.sbin/rtadvd/config.c: revision 1.43
usr.sbin/rtadvd/rtadvd.8: revision 1.27

rtadvd: Fix reloading configuration killing interface timers

rtadvd: remove support for SIOCSIFINFO_IN6
It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.

rtadvd: Add C flag to control the zeroing of the leaving configuration
This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.12 22-Mar-2021  christos - remove extra \n from stderr logging
- add string message types
- sprinkle const
 1.11 21-Apr-2020  roy rtadvd: Remove disabled use of SIOCGIFPREFIX_IN6

It's not been enabled since the functionality was added to ifconfig(8)
many many years ago.
 1.10 20-Apr-2018  roy branches: 1.10.2;
White space police.
 1.9 13-Dec-2012  roy branches: 1.9.28;
Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.8 11-Dec-2011  christos branches: 1.8.6;
- sprinkle const
- malloc + memset -> calloc
- free + malloc -> realloc
- syslog("%s", strerror(errno)) -> syslog("%m")
 1.7 10-Dec-2011  roy 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.6 05-Mar-2006  rpaulo branches: 1.6.42;
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.5 17-Jun-2003  itojun relax addrs#x config parameter. should address PR 21872
 1.4 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.3 02-Feb-2000  itojun add -R (accept router renumbering packet). now router renumbering is disabled
by default for ipsec config twists.
dies gracefully on SIGTERM.
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.6.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.6.42.1 17-Apr-2012  yamt sync with head
 1.8.6.1 25-Feb-2013  tls resync with head
 1.9.28.1 22-Apr-2018  pgoyette Sync with HEAD
 1.10.2.1 21-Apr-2020  martin Sync with HEAD
 1.18 23-Mar-2021  christos print function names as %s: not <%s> everywhere for consistency.
 1.17 16-Nov-2018  ozaki-r rtadvd: use %u to print unsigned variables
 1.16 20-Apr-2018  roy branches: 1.16.2;
White space police.
 1.15 06-Nov-2017  christos branches: 1.15.2;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.14 15-Jun-2016  riastradh branches: 1.14.8;
Omit needless casts.
 1.13 11-Nov-2015  ozaki-r Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.12 05-Jun-2015  roy Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.11 09-Jul-2013  roy Add _rtadvd user and group.
Add a chroot dir for the _rtadvd user.
Drop privs to the user _rtadvd after acquiring our socket.
When rc.d/rtadvd starts or reloads, the rtadvd config file is copied
into the chroot before starting or reloading rtadvd itself.
Create a symlink from /var/run/rtadvd.dump to the chroot

Inital idea from OpenBSD patch rtadvd.c r1.36
 1.10 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.9 10-Dec-2011  roy branches: 1.9.6;
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.8 29-Dec-2008  christos branches: 1.8.8;
fix format of time_t
 1.7 05-Mar-2006  rpaulo branches: 1.7.16;
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.6 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.5 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.4 21-May-2002  itojun correct bitmask computation. more KNF. sync w/kame
 1.3 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.2 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.1 23-May-2000  itojun branches: 1.1.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.1.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.7.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.8.8.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.8.8.2 16-Jan-2013  yamt sync with (a bit old) head
 1.8.8.1 17-Apr-2012  yamt sync with head
 1.9.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.6.1 25-Feb-2013  tls resync with head
 1.14.8.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.15.2.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.15.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.16.2.1 10-Jun-2019  christos Sync with HEAD
 1.3 20-Apr-2018  roy White space police.
 1.2 10-Dec-2011  roy branches: 1.2.38;
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.1 23-May-2000  itojun branches: 1.1.60;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.1.60.1 17-Apr-2012  yamt sync with head
 1.2.38.1 22-Apr-2018  pgoyette Sync with HEAD
 1.29 23-Mar-2021  christos print function names as %s: not <%s> everywhere for consistency.
 1.28 23-Mar-2021  christos interface indexes are unsigned
 1.27 22-Mar-2021  christos - remove extra \n from stderr logging
- add string message types
- sprinkle const
 1.26 20-Apr-2018  roy White space police.
 1.25 06-Nov-2017  christos branches: 1.25.2;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.24 11-Nov-2015  ozaki-r branches: 1.24.8;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.23 05-Jun-2015  roy Use %m in syslog(3) instead of %s strerror(3).
 1.22 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.21 12-Dec-2011  roy branches: 1.21.6;
Use RT_ADVANCE when available.
Fixes PR/44838
 1.20 11-Dec-2011  christos - sprinkle const
- malloc + memset -> calloc
- free + malloc -> realloc
- syslog("%s", strerror(errno)) -> syslog("%m")
 1.19 10-Dec-2011  roy 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.18 05-Mar-2006  rpaulo branches: 1.18.16; 1.18.42;
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.17 23-Sep-2003  itojun no need for "sdl = NULL" initialization on decl. cedric@openbsd
 1.16 23-Sep-2003  itojun simplify by using getifaddrs
 1.15 20-Sep-2003  itojun plug memory leak. from kame
 1.14 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.13 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.12 21-May-2002  itojun correct bitmask computation. more KNF. sync w/kame
 1.11 21-May-2002  itojun KNF. a memory leak fix. sync w/kame
 1.10 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.9 16-Jan-2001  cgd comment or delete text after CPP directives.
 1.8 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.7 31-Aug-2000  itojun repair interface MTU grabbing. real cause of PR 10923.
from koji@jp.above.net. sync with kame.
 1.6 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.5 23-May-2000  itojun branches: 1.5.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.4 28-Feb-2000  itojun don't assume CMSG_xx are constant. (sync with latest kame)
 1.3 08-Dec-1999  itojun sync with more recent KAME.
 1.2 06-Jul-1999  itojun branches: 1.2.4;
fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.2.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.4.2 01-Sep-2000  itojun pullup 1.6 -> 1.7 (approved by releng-1-5)

> repair interface MTU grabbing. real cause of PR 10923.
> from koji@jp.above.net. sync with kame.
 1.5.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.18.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.18.42.1 17-Apr-2012  yamt sync with head
 1.18.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.21.6.1 25-Feb-2013  tls resync with head
 1.24.8.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.25.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.13 23-Mar-2021  christos interface indexes are unsigned
 1.12 22-Mar-2021  christos - remove extra \n from stderr logging
- add string message types
- sprinkle const
 1.11 20-Apr-2018  roy White space police.
 1.10 13-Dec-2012  roy branches: 1.10.28;
Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.9 11-Dec-2011  christos branches: 1.9.6;
- sprinkle const
- malloc + memset -> calloc
- free + malloc -> realloc
- syslog("%s", strerror(errno)) -> syslog("%m")
 1.8 10-Dec-2011  roy 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.7 05-Mar-2006  rpaulo branches: 1.7.16; 1.7.42;
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.6 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.5 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.4 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.3 23-May-2000  itojun branches: 1.3.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.3.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.7.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.7.42.1 17-Apr-2012  yamt sync with head
 1.7.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.9.6.1 25-Feb-2013  tls resync with head
 1.10.28.1 22-Apr-2018  pgoyette Sync with HEAD
 1.1 06-Nov-2017  christos branches: 1.1.2;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.1.2.2 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.1.2.1 06-Nov-2017  martin file logit.h was added on branch netbsd-8 on 2017-11-21 10:54:18 +0000
 1.3 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.1 11-Nov-2015  ozaki-r Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.22 21-Apr-2020  roy rtadvd: Remove router renumbering - it's been disable for years
 1.21 20-Apr-2018  roy branches: 1.21.2;
Fix some unaligned pointer issues.
 1.20 06-Nov-2017  christos branches: 1.20.2;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.19 11-Nov-2015  ozaki-r branches: 1.19.8;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.18 05-Jun-2015  roy Use %m in syslog(3) instead of %s strerror(3).
 1.17 05-Jun-2015  roy Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.16 17-May-2013  skrll Fix typo. Reported in PR/47823.
 1.15 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.14 10-Dec-2011  roy branches: 1.14.6;
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.13 11-May-2006  mrg branches: 1.13.42;
u_char -> char for several things:
- inet_ntop()
- if_indextoname()
- variable assignment matching
char -> u_char in one place for variable assignment matching
 1.12 05-Mar-2006  rpaulo 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.11 21-Oct-2003  fvdl Don't compare an int to NULL.
 1.10 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.9 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.8 21-May-2002  itojun correct bitmask computation. more KNF. sync w/kame
 1.7 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.6 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.5 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.4 23-May-2000  itojun branches: 1.4.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.3 13-Mar-2000  itojun bring in latest kame tree. this fixes unclosed file descdriptor
in router renumbering case.
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.4.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.13.42.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.13.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.13.42.1 17-Apr-2012  yamt sync with head
 1.14.6.2 23-Jun-2013  tls resync from head
 1.14.6.1 25-Feb-2013  tls resync with head
 1.19.8.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.20.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.21.2.1 21-Apr-2020  martin Sync with HEAD
 1.7 21-Apr-2020  roy rtadvd: Remove router renumbering - it's been disable for years
 1.6 20-Apr-2018  roy branches: 1.6.2;
White space police.
 1.5 10-Dec-2011  roy branches: 1.5.38;
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.4 21-Jan-2001  itojun branches: 1.4.56;
sync with latest kame.
- make icmp6.h spec conformant to 2292bis-02, regarding to router reumbering
flag bit.
- latest rtadvd.
 1.3 23-May-2000  itojun sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.4.56.1 17-Apr-2012  yamt sync with head
 1.5.38.1 22-Apr-2018  pgoyette Sync with HEAD
 1.6.2.1 21-Apr-2020  martin Sync with HEAD
 1.29 21-Apr-2020  wiz Remove -M from SYNOPSIS as well.
 1.28 21-Apr-2020  roy rtadvd: Remove router renumbering - it's been disable for years
 1.27 11-Nov-2019  roy rtadvd: Add C flag to control the zeroing of the leaving configuration

This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.26 06-Nov-2017  christos branches: 1.26.4; 1.26.6;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.25 16-Dec-2016  ozaki-r branches: 1.25.6;
Support -p <pidfile> option

It's needed to avoid using /var/run/rtadvd.pid on ATF tests and
run multiple instances of rump.rtadvd on a test.
 1.24 13-Dec-2012  wiz branches: 1.24.12;
Formatting nit.
 1.23 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.22 28-Apr-2011  wiz branches: 1.22.4; 1.22.10;
Sort sections.
 1.21 05-Mar-2006  rpaulo branches: 1.21.16;
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.20 31-Oct-2005  wiz Small improvements. Sort options. From jmc@openbsd.
 1.19 07-Sep-2003  wiz Consistently use 'RFC 1234' instead of 'RFC1234' or 'RFC-1234'.
From jmc@openbsd.
 1.18 30-Mar-2003  perry ipng->IPng, from Igor Sobrado in PR misc/20755 (though its a nit, ipng is fine.
 1.17 29-May-2002  wiz Grammar improvements.
 1.16 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.15 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.14 02-Feb-2002  wiz Use standard headers.
 1.13 04-Feb-2001  itojun avoid infinite loop when -s is specified (select loop mistake).
make agetent() 32bit clean. KAME PR 127.
disable -R (router renumbering receiver). sync with kame.
 1.12 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.11 15-Oct-2000  bjh21 Grammatical and formatting cleanups.
 1.10 04-Sep-2000  kleink For commands and utilities, use EXIT STATUS rather than RETURN VALUES or
DIAGNOSTICS as appropriate (and documented in mdoc(7)).
 1.9 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.8 23-May-2000  itojun branches: 1.8.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.7 13-Mar-2000  itojun bring in latest kame tree. this fixes unclosed file descdriptor
in router renumbering case.
 1.6 02-Feb-2000  itojun add -R (accept router renumbering packet). now router renumbering is disabled
by default for ipsec config twists.
dies gracefully on SIGTERM.
 1.5 24-Jan-2000  itojun fix pathname for rtadvd.conf. (/etc/rtadvd.conf for netbsd-current)
 1.4 06-Jan-2000  itojun grammar fix. sync with latest KAME.
 1.3 08-Dec-1999  itojun fix pathname to /etc/rtadvd.conf.
NetBSD PR: 8966
 1.2 08-Jul-1999  itojun branches: 1.2.4;
sync with KAME/NetBSD14.
add warning about upstream/downstream advertisement.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.2.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.21.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.22.10.1 25-Feb-2013  tls resync with head
 1.22.4.2 23-Jan-2013  yamt sync with head
 1.22.4.1 16-Jan-2013  yamt sync with (a bit old) head
 1.24.12.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.25.6.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.26.6.1 11-Nov-2019  martin Pull up following revision(s) (requested by roy in ticket #417):

usr.sbin/rtadvd/rtadvd.c: revision 1.70
usr.sbin/rtadvd/rtadvd.c: revision 1.71
usr.sbin/rtadvd/rtadvd.h: revision 1.20
usr.sbin/rtadvd/config.c: revision 1.42
usr.sbin/rtadvd/config.c: revision 1.43
usr.sbin/rtadvd/rtadvd.8: revision 1.27

rtadvd: Fix reloading configuration killing interface timers

rtadvd: remove support for SIOCSIFINFO_IN6
It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.

rtadvd: Add C flag to control the zeroing of the leaving configuration
This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.26.4.2 21-Apr-2020  martin Sync with HEAD
 1.26.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.83 26-Feb-2025  andvar Fix typos in comments, mainly s/calcurate/calculate/.
 1.82 23-Mar-2021  christos branches: 1.82.8;
call tzset() before chroot so we initialize our timezone data
 1.81 23-Mar-2021  christos fix misplaced paren, add missing va_end()
 1.80 22-Mar-2021  christos - remove extra \n from stderr logging
- add string message types
- sprinkle const
 1.79 28-Aug-2020  rjs Use wrapper name for call to setsockopt(2), NFC for non-rump builds.
 1.78 14-May-2020  christos If we could not lock the pid file, don't continue as we end up with multiple
rtadvd's (thanks roy@)
 1.77 10-May-2020  christos warn only for > INFO level messages.
 1.76 10-May-2020  christos Print errors to stderr until we daemonize.
Fix typo.
 1.75 21-Apr-2020  wiz Remove dst variable that was only set but not used.

(This broke the build for me.)
 1.74 21-Apr-2020  wiz Update getopt string.

Remove -M. Add -C (the code is there and documented, even if noone could
activate it...).
Sync usage with manpage.
 1.73 21-Apr-2020  roy rtadvd: Remove disabled use of SIOCGIFPREFIX_IN6

It's not been enabled since the functionality was added to ifconfig(8)
many many years ago.
 1.72 21-Apr-2020  roy rtadvd: Remove router renumbering - it's been disable for years
 1.71 11-Nov-2019  roy rtadvd: Add C flag to control the zeroing of the leaving configuration

This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.70 10-Nov-2019  roy rtadvd: Fix reloading configuration killing interface timers
 1.69 29-Mar-2019  christos branches: 1.69.2;
- die sooner (if we got interrupted)
- when we finish resending exit.
 1.68 12-Jan-2019  christos adjust to new expandm.
 1.67 11-Jan-2019  christos use expandm from libwrap.
 1.66 24-Apr-2018  roy branches: 1.66.2;
Back out part of the prior commit where we added space for IPV6_HOPLIMIT
to the sending control message buffer.
That code never worked on ERLITE, so I elected to set socket options
instead but forgot to revert this part.
 1.65 20-Apr-2018  roy Unicast solicited RA's as per RFC 7772.

This is done by having a secondary timer against rainfo so we
can delay unicasting by the required randomised amount of time
without affecting the unsolicited RA timer.
 1.64 20-Apr-2018  roy Insist on newer socket options.
 1.63 20-Apr-2018  roy Use pidifle_lock(3)
 1.62 20-Apr-2018  roy Punt dead code
 1.61 20-Apr-2018  roy White space police.
 1.60 20-Apr-2018  roy Fix some unaligned pointer issues.
 1.59 25-Nov-2017  kre branches: 1.59.2;

When sending log messages to stderr, append the \n that syslog does not need.
 1.58 06-Nov-2017  joerg Mark expandm as preserving format strings.
 1.57 06-Nov-2017  christos Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.56 14-Oct-2017  christos PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces

- make syscalls checks against -1
- fix errors to print %s: instead of <%s>

XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..
 1.55 11-Sep-2017  christos Don't start another copy of rtadvd if one is running.
 1.54 11-Sep-2017  christos KNF, fix time printing formats.
 1.53 11-Apr-2017  roy branches: 1.53.4;
Use RO_MSGFILTER.
 1.52 16-Dec-2016  ozaki-r branches: 1.52.2;
Support -p <pidfile> option

It's needed to avoid using /var/run/rtadvd.pid on ATF tests and
run multiple instances of rump.rtadvd on a test.
 1.51 11-Nov-2015  ozaki-r branches: 1.51.2;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.50 15-Jun-2015  ozaki-r Fix regression on sending RA messages

r1.48 dropped hoplimit cmsg but forgot to adjust cmsg buffer length.

Reported by Timo Buhrmester
 1.49 05-Jun-2015  roy Use %m in syslog(3) instead of %s strerror(3).
 1.48 05-Jun-2015  roy Set the hoplimit of 255 as specified in RFC 4861 section 4.2
using the IPV6_MULTICAST_HOPS socket option rather than using CMSG
when constructing each message.
 1.47 05-Jun-2015  roy Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.46 27-Feb-2014  joerg Expect long long to be larger than uint32_t and use llabs after casting
the uint32_t.
 1.45 26-Jan-2014  plunky spelling correction - recieved -> received
 1.44 09-Jul-2013  roy Add _rtadvd user and group.
Add a chroot dir for the _rtadvd user.
Drop privs to the user _rtadvd after acquiring our socket.
When rc.d/rtadvd starts or reloads, the rtadvd config file is copied
into the chroot before starting or reloading rtadvd itself.
Create a symlink from /var/run/rtadvd.dump to the chroot

Inital idea from OpenBSD patch rtadvd.c r1.36
 1.43 28-Jun-2013  roy If we die and there are no timers, just exit.
 1.42 27-Jun-2013  roy Check valid lengths of RDNSS and DNSSL options when rtadvd receives RA/RS.
rtadvd doesn't actually look into the option itself, but it may do in the
future to warn about consistency.
 1.41 14-Dec-2012  roy Intsead of forcing out each RA at shutdown and sleeping we now use
the existing timer model and wait for each RA to expire itself after
sending the required number of transmissions.

This allows for a faster and saner shutdown.
 1.40 13-Dec-2012  roy Remove debug stuff.
 1.39 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.38 11-Dec-2011  christos branches: 1.38.6;
- sprinkle const
- malloc + memset -> calloc
- free + malloc -> realloc
- syslog("%s", strerror(errno)) -> syslog("%m")
 1.37 11-Dec-2011  joerg Use __dead. No prototype for main.
 1.36 10-Dec-2011  roy 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.35 19-Apr-2009  lukem branches: 1.35.6;
fix -Wshadow
 1.34 16-Jan-2007  hubertf branches: 1.34.8; 1.34.20;
* Don't include headers twice
* Remove a few trailing whitespaces
* Rearrange and join to one #if for some headers

Patch contributed by Slava Semushin <slava.semushin@gmail.com>
in private mail.
 1.33 07-Oct-2006  elad PR/18906: roskens at elfin dot net: misc. select() to poll() updates.

Adapted to -current by myself, thanks for the patch!
 1.32 02-Aug-2006  tron Make sure the buffer used to retrieve routing message from the kernel
is properly aligned. This should fix PR bin/34124.
 1.31 11-May-2006  mrg u_char -> char for several things:
- inet_ntop()
- if_indextoname()
- variable assignment matching
char -> u_char in one place for variable assignment matching
 1.30 05-Mar-2006  rpaulo 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.29 31-Oct-2005  wiz Sync usage with man page.
 1.28 14-Mar-2003  itojun branches: 1.28.4; 1.28.6;
correct use of sizeof
 1.27 14-Mar-2003  itojun add missing ND option length validation. from kame
 1.26 23-Sep-2002  mycroft null commit
 1.25 23-Sep-2002  itojun poll.h, not sys/poll.h
 1.24 20-Sep-2002  mycroft Set fd of unused pollfd entries to -1.
 1.23 20-Sep-2002  mycroft select() -> poll()
 1.22 08-Sep-2002  itojun signal handler must take "int" arg. from deraadt, sync w/kame
 1.21 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.20 07-Jun-2002  itojun use arc4random
 1.19 07-Jun-2002  itojun avoid fd_set overrun. sync w/kame
 1.18 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.17 21-May-2002  itojun branches: 1.17.2;
use pidfile(3). sync w/kame
 1.16 21-May-2002  itojun minor sync w/kame (prototype location)
 1.15 21-May-2002  itojun correct bitmask computation. more KNF. sync w/kame
 1.14 21-May-2002  itojun KNF. a memory leak fix. sync w/kame
 1.13 11-Jan-2002  itojun daemon(3) has to be called before opening file descriptors.
noticed by markus@openbsd, sync with kame
 1.12 04-Feb-2001  itojun avoid infinite loop when -s is specified (select loop mistake).
make agetent() 32bit clean. KAME PR 127.
disable -R (router renumbering receiver). sync with kame.
 1.11 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.10 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.9 23-May-2000  itojun branches: 1.9.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.8 27-Mar-2000  kleink Cast timeval members to types we know the printf conversions of.
 1.7 13-Mar-2000  itojun bring in latest kame tree. this fixes unclosed file descdriptor
in router renumbering case.
 1.6 28-Feb-2000  itojun don't assume CMSG_xx are constant. (sync with latest kame)
 1.5 02-Feb-2000  itojun add -R (accept router renumbering packet). now router renumbering is disabled
by default for ipsec config twists.
dies gracefully on SIGTERM.
 1.4 10-Dec-1999  itojun sync with recent KAME. give a better debugging information.
 1.3 08-Dec-1999  itojun sync with more recent KAME.
 1.2 06-Jul-1999  itojun branches: 1.2.4;
fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.2.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.4.2 17-Mar-2003  itojun usr.sbin/rtadvd/rtadvd.c 1.27-1.28 (via patch)

Add missing ND option length validation. From KAME.
[itojun, ticket #32]
 1.9.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.17.2.3 09-May-2006  tron Apply patch (requested by martti in ticket #6074):
Process Source Link-Layer Address (SLLA) option correctly.
 1.17.2.2 02-Jun-2003  tron Pull up revision 1.28 (requested by itojun in ticket #1212):
correct use of sizeof
 1.17.2.1 02-Jun-2003  tron Pull up revision 1.27 (requested by itojun in ticket #1212):
add missing ND option length validation. from kame
 1.28.6.1 09-May-2006  tron Apply patch (requested by martti in ticket #1308):
Process Source Link-Layer Address (SLLA) option correctly.
 1.28.4.1 09-May-2006  tron Apply patch (requested by martti in ticket #10527):
Process Source Link-Layer Address (SLLA) option correctly.
 1.34.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.34.8.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.35.6.4 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.35.6.3 23-Jan-2013  yamt sync with head
 1.35.6.2 16-Jan-2013  yamt sync with (a bit old) head
 1.35.6.1 17-Apr-2012  yamt sync with head
 1.38.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.6.1 25-Feb-2013  tls resync with head
 1.51.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.51.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.52.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.53.4.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.59.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.59.2.2 02-May-2018  pgoyette Synch with HEAD
 1.59.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.66.2.3 21-Apr-2020  martin Sync with HEAD
 1.66.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.66.2.1 10-Jun-2019  christos Sync with HEAD
 1.69.2.1 11-Nov-2019  martin Pull up following revision(s) (requested by roy in ticket #417):

usr.sbin/rtadvd/rtadvd.c: revision 1.70
usr.sbin/rtadvd/rtadvd.c: revision 1.71
usr.sbin/rtadvd/rtadvd.h: revision 1.20
usr.sbin/rtadvd/config.c: revision 1.42
usr.sbin/rtadvd/config.c: revision 1.43
usr.sbin/rtadvd/rtadvd.8: revision 1.27

rtadvd: Fix reloading configuration killing interface timers

rtadvd: remove support for SIOCSIFINFO_IN6
It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.

rtadvd: Add C flag to control the zeroing of the leaving configuration
This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.82.8.1 02-Aug-2025  perseant Sync with HEAD
 1.4 01-Nov-2009  jakllsch Use documentation prefix.
 1.3 05-Mar-2006  rpaulo 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.2 25-Jun-2003  itojun "addrs" is not needed any more
 1.1 21-Jan-2001  itojun make it clearer that /etc/rtadvd.conf is optional (normally,
configurations were derived from kernel interface settings).

install rtadvd.conf into /usr/share/exapmles/rtadvd, instead of /etc.

sync with kame.
 1.20 21-Apr-2018  wiz Minor improvements.
 1.19 20-Apr-2018  roy Update values from RFC 8319
 1.18 11-Dec-2012  roy branches: 1.18.28;
Add support for the noifprefix keyword which stops rtadvd(8) gathing prefix
information from the interface if no addrs are present in rtadvd.conf(5).
 1.17 21-Apr-2012  roy branches: 1.17.2;
Add capfile(5) to describe the termcap format.
Adjust various man pages and other documentation to point to capfile(5)
instead of termcap(5).
Remove getcap(3) as curses hasn't been building it for a long time.
Punt wrterm.c as tset no longer uses it.
 1.16 29-Mar-2012  wiz - improve wording;
- replace references to resolver(5) with ones to resolv.conf(5);
- remove references to FreeBSD (which were copied 1:1 from their
man page).

From patch by Bug Hunting.
 1.15 10-Dec-2011  roy 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.14 01-Nov-2009  jakllsch branches: 1.14.6;
Use documentation prefix.
Drop trailing whitespace.
Remove repeated word.
Bump date.
 1.13 24-Aug-2009  joerg Kill -offset without argument.
 1.12 05-Mar-2006  rpaulo branches: 1.12.16;
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.11 04-Jul-2003  wiz Bump date for recent changes.
 1.10 18-Jun-2003  itojun need "a". from jmc@openbsd
 1.9 18-Jun-2003  itojun sync manpage with previous change (addrs# deprecdated)
 1.8 02-Oct-2002  wiz between with three es, and positive with two is.
 1.7 02-Feb-2002  wiz Drop a .Pp.
 1.6 21-Jan-2001  itojun make it clearer that /etc/rtadvd.conf is optional (normally,
configurations were derived from kernel interface settings).

install rtadvd.conf into /usr/share/exapmles/rtadvd, instead of /etc.

sync with kame.
 1.5 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.4 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.3 23-May-2000  itojun branches: 1.3.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 03-Jul-1999  itojun fix typo (no comma).
use NetBSD RCS ID, retain original.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.3.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.12.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.14.6.3 16-Jan-2013  yamt sync with (a bit old) head
 1.14.6.2 23-May-2012  yamt sync with head.
 1.14.6.1 17-Apr-2012  yamt sync with head
 1.17.2.1 25-Feb-2013  tls resync with head
 1.18.28.1 22-Apr-2018  pgoyette Sync with HEAD
 1.21 22-Mar-2021  christos - remove extra \n from stderr logging
- add string message types
- sprinkle const
 1.20 11-Nov-2019  roy rtadvd: Add C flag to control the zeroing of the leaving configuration

This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.19 20-Apr-2018  roy branches: 1.19.2; 1.19.4;
Update values from RFC 8319
 1.18 20-Apr-2018  roy Make the #defines more readable
 1.17 20-Apr-2018  roy Unicast solicited RA's as per RFC 7772.

This is done by having a secondary timer against rainfo so we
can delay unicasting by the required randomised amount of time
without affecting the unsolicited RA timer.
 1.16 20-Apr-2018  roy White space police.
 1.15 27-Feb-2017  ozaki-r branches: 1.15.10;
Fix the default value of rltime

According to rtadvd.conf(5), the default value of rltime is 1800 seconds.

PR bin/51994
 1.14 05-Jun-2015  roy branches: 1.14.2; 1.14.4;
Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.13 09-Jul-2013  roy branches: 1.13.6; 1.13.8; 1.13.12;
Add _rtadvd user and group.
Add a chroot dir for the _rtadvd user.
Drop privs to the user _rtadvd after acquiring our socket.
When rc.d/rtadvd starts or reloads, the rtadvd config file is copied
into the chroot before starting or reloading rtadvd itself.
Create a symlink from /var/run/rtadvd.dump to the chroot

Inital idea from OpenBSD patch rtadvd.c r1.36
 1.12 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.11 10-Dec-2011  roy branches: 1.11.2; 1.11.6; 1.11.8; 1.11.10;
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.10 05-Mar-2006  rpaulo branches: 1.10.16; 1.10.42;
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.9 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.8 21-May-2002  itojun minor sync w/kame (prototype location)
 1.7 21-May-2002  itojun KNF. a memory leak fix. sync w/kame
 1.6 15-Jan-2001  itojun sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
 1.5 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.4 23-May-2000  itojun branches: 1.4.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.3 13-Mar-2000  itojun bring in latest kame tree. this fixes unclosed file descdriptor
in router renumbering case.
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.4.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.10.42.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.10.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.10.42.1 17-Apr-2012  yamt sync with head
 1.10.16.1 22-Feb-2008  keiichi imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).
 1.11.10.1 14-Jul-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1440):
usr.sbin/rtadvd/rtadvd.h: revision 1.15
usr.sbin/rtadvd/config.c: revision 1.36
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.11.8.1 14-Jul-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1440):
usr.sbin/rtadvd/rtadvd.h: revision 1.15
usr.sbin/rtadvd/config.c: revision 1.36
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.11.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.6.1 25-Feb-2013  tls resync with head
 1.11.2.1 14-Jul-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1440):
usr.sbin/rtadvd/rtadvd.h: revision 1.15
usr.sbin/rtadvd/config.c: revision 1.36
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.13.12.1 12-May-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1373):
usr.sbin/rtadvd/config.c: revision 1.36
usr.sbin/rtadvd/rtadvd.h: revision 1.15
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.13.8.1 12-May-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1373):
usr.sbin/rtadvd/config.c: revision 1.36
usr.sbin/rtadvd/rtadvd.h: revision 1.15
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.13.6.1 12-May-2017  snj Pull up following revision(s) (requested by ozaki-r in ticket #1373):
usr.sbin/rtadvd/config.c: revision 1.36
usr.sbin/rtadvd/rtadvd.h: revision 1.15
Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.
PR bin/51994
 1.14.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.14.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.15.10.1 22-Apr-2018  pgoyette Sync with HEAD
 1.19.4.1 11-Nov-2019  martin Pull up following revision(s) (requested by roy in ticket #417):

usr.sbin/rtadvd/rtadvd.c: revision 1.70
usr.sbin/rtadvd/rtadvd.c: revision 1.71
usr.sbin/rtadvd/rtadvd.h: revision 1.20
usr.sbin/rtadvd/config.c: revision 1.42
usr.sbin/rtadvd/config.c: revision 1.43
usr.sbin/rtadvd/rtadvd.8: revision 1.27

rtadvd: Fix reloading configuration killing interface timers

rtadvd: remove support for SIOCSIFINFO_IN6
It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.

rtadvd: Add C flag to control the zeroing of the leaving configuration
This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).
 1.19.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 10-Jan-2017  christos need <time.h> for clock_gettime
 1.1 11-Nov-2015  ozaki-r branches: 1.1.2;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.1.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1 11-Nov-2015  ozaki-r Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.20 23-Mar-2021  christos print function names as %s: not <%s> everywhere for consistency.
 1.19 03-Dec-2019  msaitoh s/upate/update/ in comment.
 1.18 20-Apr-2018  roy branches: 1.18.2;
Lack of timeout is a programming error, so use an assert in it's place.
While here, improve the error reported if malloc fails.
 1.17 20-Apr-2018  roy Use EXIT_FAILURE instead of an arbtitary number.
 1.16 20-Apr-2018  roy Allow timers to exist but be inactive.
This will be used in a future commit.
 1.15 20-Apr-2018  roy White space police.
 1.14 06-Nov-2017  christos branches: 1.14.2;
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).
 1.13 11-Nov-2015  ozaki-r branches: 1.13.8;
Introduce rump.rtadvd

It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
 1.12 05-Jun-2015  roy Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.11 13-Dec-2012  roy Remove the iflist array and store ifflags in rainfo.

Add support for SIGHUP to re-read the configuration for each interface.
If an invalid configuration is found, we continue to use the old one;
otherwise we expire the current one and then start advertising the new one.

Specififed interfaces don't have to exist at startup.
If specified interfaces arrive, load their config and start advertising.
If they depart, remove their rainfo structure and continue.

Fixes PR/43881 and PR/47311
 1.10 10-Dec-2011  roy branches: 1.10.6;
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.9 05-Mar-2006  rpaulo branches: 1.9.42;
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.8 10-Jul-2002  itojun byebye __FUNCTIION__. sync w/kame
 1.7 29-May-2002  itojun KNF, strlcpy, memory leak fix, random other cleanups. sync w/kame
 1.6 21-May-2002  itojun correct bitmask computation. more KNF. sync w/kame
 1.5 21-May-2002  itojun KNF. a memory leak fix. sync w/kame
 1.4 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.3 23-May-2000  itojun branches: 1.3.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.3.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.9.42.2 16-Jan-2013  yamt sync with (a bit old) head
 1.9.42.1 17-Apr-2012  yamt sync with head
 1.10.6.1 25-Feb-2013  tls resync with head
 1.13.8.1 21-Nov-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #358):
usr.sbin/rtadvd/rtadvd.c: revision 1.54-1.58
usr.sbin/rtadvd/config.c: revision 1.37
usr.sbin/rtadvd/if.c: revision 1.25
usr.sbin/rtadvd/dump.c: revision 1.15
usr.sbin/rtadvd/rrenum.c: revision 1.20
usr.sbin/rtadvd/logit.h: revision 1.1
usr.sbin/rtadvd/rtadvd.8: revision 1.26
tests/net/ndp/t_ra.sh: revision 1.30
usr.sbin/rtadvd/timer.c: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.31
usr.sbin/rtadvd/advcap.c: revision 1.17

KNF, fix time printing formats.

Don't start another copy of rtadvd if one is running.

PR/52618: Shinichi Doyashiki: Don't exit if adding interface to multicast
group fails. This happens with empty vlan interfaces
- make syscalls checks against -1
- fix errors to print %s: instead of <%s>
XXX: if_vlan is the only pseudo interface in net/ that returns such an
error..

Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.

Change the meaning of the D flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).

Mark expandm as preserving format strings.

Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.
Address PR bin/52701
 1.14.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.18.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10 20-Apr-2018  roy Allow timers to exist but be inactive.
This will be used in a future commit.
 1.9 20-Apr-2018  roy White space police.
 1.8 05-Jun-2015  roy branches: 1.8.14;
Use clock_gettime(2) instead of gettimeofday(2) so we can use a monotonic
clock rather than the wall clock.
Use timespec rather than timeval structs to make this transition easier.
Kill custom timeval comparison functions in favor of timespeccmp(3).
 1.7 10-Dec-2011  roy 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.6 05-Mar-2006  rpaulo branches: 1.6.42;
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.5 21-May-2002  itojun KNF. a memory leak fix. sync w/kame
 1.4 06-Jul-2000  itojun sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.
 1.3 23-May-2000  itojun branches: 1.3.4;
sync with latest kame.
- decrease warning level on missing rtadvd.conf (actually, the file
can be omitted)
- strict prototype
- gather stats better, emit stats on SIGUSR1 to /var/run
 1.2 06-Jul-1999  itojun fix for 64bit arch, where sizeof(size_t) != sizeof(int).
add NetBSD RCS ID.
 1.1 02-Jul-1999  itojun rtadvd: advertise IPv6 prefix info via router advertisement.
(to be run on routers)
 1.3.4.1 20-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)
sync with sys/netinet/icmp6.h change (no bitfield for router renumber).
more logging. improve error handling/garbage collection. sync with kame.

1.1 -> 1.2 basesrc/usr.sbin/rtadvd/dump.c
1.5 -> 1.6 basesrc/usr.sbin/rtadvd/if.c
1.3 -> 1.4 basesrc/usr.sbin/rtadvd/if.h \
basesrc/usr.sbin/rtadvd/rtadvd.conf.5 basesrc/usr.sbin/rtadvd/timer.c \
basesrc/usr.sbin/rtadvd/timer.h
1.4 -> 1.5 basesrc/usr.sbin/rtadvd/rrenum.c \
basesrc/usr.sbin/rtadvd/rtadvd.h
1.8 -> 1.9 basesrc/usr.sbin/rtadvd/rtadvd.8
1.9 -> 1.10 basesrc/usr.sbin/rtadvd/rtadvd.c
 1.6.42.1 17-Apr-2012  yamt sync with head
 1.8.14.1 22-Apr-2018  pgoyette Sync with HEAD

RSS XML Feed