Commit Graph

40 Commits

Author SHA1 Message Date
Hiroki Sato
33631085f8 - Add missing "static" keywords.
- Add a check for ifindex to if_indextoifinfo().  It returns NULL when
  if_indextoname() fails.

MFC after:	3 days
2013-07-09 07:08:36 +00:00
Hiroki Sato
833d853cbf Fix SIGSEGV when set_short_delay() is called when ifi->ifi_ra_timer is NULL.
This can happen in a short period when a prefix is changed by a rtmsg and a
new interface arrives.
2013-03-06 04:58:48 +00:00
Dag-Erling Smørgrav
c1803a93a4 - Implement and use usage().
- Document the -C option.
- Allow rtadvd to be invoked without any interfaces on the command line,
  and document that possibility.

MFC after:	1 week
2013-02-25 16:47:09 +00:00
Ulrich Spörlein
3df5ecac8c Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00
Hiroki Sato
8cdd0a8091 Remove RA timer on an interface with !IFF_UP actively after starting to send
clean-up RA messages for shutting down.  The RA timers could prevent the rtadvd
daemon from shutting down because ra_output() just ignored !IFF_UP interfaces
and TRANSITIVE->UNCONFIGURED state transition never happened due to it.

Spotted by:	kib
Approved by:	re (bz)
2011-09-20 00:32:30 +00:00
Hiroki Sato
aed378729e - Fix a bug that can lead to displaying an incorrect value. (r224210)
- Fix an abnormal termination caused by twice of "rtadvctl disable". (r224303)
- Use poll() to wait for the control message socket instead of a spin loop.
  (r224304)
- s/cmsg_/cm_/ to avoid conflict with CMSG_* symbols for struct cmsghdr.
  (r224619)
- Ignore an interface that never sent RAs for graceful shut-down. (r224620)
- Refine log messages. (r225148)
- Fix SIGSEGV when receiving RAs that contain RDNSS and/or DNSSL options.
  (r225149)

Approved by:	re (kib)
2011-09-12 23:52:55 +00:00
Hiroki Sato
3724189620 - Improve interface list handling. The rtadvd(8) now supports dynamically-
added/removed interfaces in a more consistent manner and reloading the
  configuration file.

- Implement burst unsolicited RA sending into the internal RA timer framework
  when AdvSendAdvertisements and/or configuration entries are changed as
  described in RFC 4861 6.2.4.  This fixes issues that make termination of the
  rtadvd(8) daemon take very long time.

  An interface now has three internal states, UNCONFIGURED, TRANSITIVE, or
  CONFIGURED, and the burst unsolicited sending happens in TRANSITIVE.
  See rtadvd.h for the details.

- rtadvd(8) now accepts non-existent interfaces as well in the command line.

- Add control socket support and rtadvctl(8) utility to show the RA information
  in rtadvd(8).  Dumping by SIGUSR1 has been removed in favor of it.
2011-07-17 19:24:54 +00:00
Hiroki Sato
729d2abb51 Support SIGHUP for reloading /etc/rtadvd.conf. 2011-06-11 03:25:10 +00:00
Hiroki Sato
587d184d3d Fix build on 64-bit arch.
Submitted by:	dim
Pointy hat to:	hrs
2011-06-06 10:51:00 +00:00
Hiroki Sato
db82af41db - Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement
Options for DNS Configuration) into rtadvd(8) and rtsold(8).  DNS
  information received by rtsold(8) will go to resolv.conf(5) by
  resolvconf(8) script.  This is based on work by J.R. Oldroyd (kern/156259)
  but revised extensively[1].

- rtadvd(8) now supports "noifprefix" to disable gathering on-link prefixes
  from interfaces when no "addr" is specified[2].  An entry in rtadvd.conf
  with "noifprefix" + no "addr" generates an RA message with no prefix
  information option.

- rtadvd(8) now supports RTM_IFANNOUNCE message to fix crashes when an
  interface is added or removed.

- Correct bogus ND_OPT_ROUTE_INFO value to one in RFC 4191.

Reviewed by:	bz[1]
PR:		kern/156259 [1]
PR:		bin/152458 [2]
2011-06-06 03:06:43 +00:00
Bjoern A. Zeeb
5033bae6d0 Prevent crashes from a race when (cloned) interfaces go away.
PR:		bin/152143
Submitted by:	Przemyslaw Frasunek (przemyslaw frasunek.com)
Tested by:	Przemyslaw Frasunek (przemyslaw frasunek.com)
MFC after:	1 week
2011-03-02 17:13:07 +00:00
Xin LI
f49f3df86a Allow overriding pidfile and dumpfile.
PR:		bin/153362
Submitted by:	Joe Holden <joe rewt org uk>
MFC after:	1 month
2010-12-22 23:58:21 +00:00
Andrey A. Chernov
f90b161b21 Change 2 arc4random modulo operations to arc4random_uniform() as
OpenBSD does, since modulo is not power of 2.

Obtained from:  OpenBSD
2008-07-26 15:39:32 +00:00
Kevin Lo
784bddbc5b Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
Maxim Konovalov
ba5b74d001 o Remove duplicate includes.
Obtained from:	Slava Semushin via NetBSD
2007-01-20 08:24:02 +00:00
SUZUKI Shinsuke
09f3617564 changed syslog level to more appropriate ones
Obtained from: KAME
Reviewd by: ume, gnn
MFC after: 2 weeks
2005-10-19 15:19:06 +00:00
SUZUKI Shinsuke
375ef204cd source link-layer address option should be marked to be checked later,
because rs_input() need this option.

Obtained from: KAME
Reviewed by: ume, gnn
MFC after: 2 weeks
2005-10-19 15:14:28 +00:00
Hajimu UMEMOTO
fc35a81b09 - supported a string notation for xxflags.
- deprecate routes#N, as it is hard to keep consistency with
  rtprefixN.  accept any number of "rtprefix", "rtrefix0",
  ..., "rtprefix99".
- deprecate "addrs#N", as it is difficult for users to keep
  consistency with "addrN".
  accept 100 prefix info in maximum - like "addr", "addr0"
  ... "addr99".  WARNS=2 clean on netbsd.
  old configuration file should work just fine.
  behavior change:
  previously, we rejected "addrN" if there's "addr", and we rejected
  "addr" if there is "addrN".  now we accept both without problem.
- when an advertised prefix configured from the kernel has been added
  or invalidated, notice the change in a short delay.
- when invalidating a prefix, do not bark even if there is
  inconsistency about prefix lifetimes.
- wrap more specific route info code into ROUTEINFO.

Obtained from:	KAME
MFC after:	1 week
2003-08-15 19:13:53 +00:00
Hajimu UMEMOTO
dba14c305c use arc4random.
Obtained from:	KAME
MFC after:	1 week
2003-08-15 17:51:51 +00:00
Hajimu UMEMOTO
51964a1b2b variable shared with signal handler needs to be "volatile sig_atomic_t".
Obtained from:	KAME
MFC after:	1 week
2003-08-15 17:20:49 +00:00
Hajimu UMEMOTO
fbcc332a1d set LOG_PERROR for openlog() when running foreground.
Obtained from:	KAME
MFC after:	1 week
2003-08-15 17:15:10 +00:00
Hajimu UMEMOTO
145b960169 daemon() has to be called prior to file descriptor setups
(otherwise file descriptors could be closed mistakenly)

Obtained from:	KAME
MFC after:	1 week
2003-08-14 19:05:24 +00:00
Hajimu UMEMOTO
5c706347d5 support poll(2).
Obtained from:	KAME
MFC after:	1 week
2003-08-14 18:43:57 +00:00
Hajimu UMEMOTO
4eb4a0e6ec - rename some variables.
- remove unused block.

Obtained from:	KAME
MFC after:	1 week
2003-08-14 16:51:13 +00:00
Hajimu UMEMOTO
71aa258ee8 signal handler must take "int" arg.
Obtained from:	KAME
MFC after:	1 week
2003-08-14 16:23:39 +00:00
Hajimu UMEMOTO
eaa5529180 avoid fd_set overrun.
Obtained from:	KAME
MFC after:	1 week
2003-08-14 16:19:59 +00:00
Hajimu UMEMOTO
be9879af48 Drop MIP6 code. We don't support MIP6 yet.
MFC after:	1 week
2003-08-08 20:14:28 +00:00
Hajimu UMEMOTO
fa19f9be04 KNF, correct typos and cleanup spaces.
Obtained from:	KAME
MFC after:	1 week
2003-08-08 16:56:01 +00:00
Hajimu UMEMOTO
1533bed05b __FUNCTION__ --> __func__
Obtained from:	KAME
MFC after:	1 week
2003-08-08 16:38:23 +00:00
Hajimu UMEMOTO
8a9448cabc tightened check for the length of ND options.
Submitted by:	jinmei@kame.net (JINMEI Tatuya)
Obtained from:	KAME
2003-03-26 17:28:47 +00:00
Andrey A. Chernov
9328833aac Use srandomdev() for FreeBSD 2003-02-11 02:21:41 +00:00
Hajimu UMEMOTO
0a5f3ef410 Changed the behavior when an interface-direct prefix being advertised
was removed from the kernel;
Advertise the prefix with zero lifetimes rather than to remove the prefix
from the prefix list to be advertised.
This will help renumber a receiving host by deprecating the address
derived from the old prefix.

Obtained from:	KAME
MFC after:	2 weeks
2002-06-13 16:59:31 +00:00
Hajimu UMEMOTO
c7aec5cc57 Skip duplicated prefixes in get_prefix().
Obtained from:	KAME
2002-06-01 19:16:13 +00:00
Hajimu UMEMOTO
99a92b2c8a KNF
Obtained from:	KAME
2002-06-01 17:28:12 +00:00
Hajimu UMEMOTO
3384154590 Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some
critical problem after the snap was out were fixed.
There are many many changes since last KAME merge.

TODO:
  - The definitions of SADB_* in sys/net/pfkeyv2.h are still different
    from RFC2407/IANA assignment because of binary compatibility
    issue.  It should be fixed under 5-CURRENT.
  - ip6po_m member of struct ip6_pktopts is no longer used.  But, it
    is still there because of binary compatibility issue.  It should
    be removed under 5-CURRENT.

Reviewed by:	itojun
Obtained from:	KAME
MFC after:	3 weeks
2001-06-11 12:39:29 +00:00
Jun-ichiro itojun Hagino
ae3267258a make it easier to handle $FreeBSD$ tags (amount of diff matters). 2001-01-21 15:25:46 +00:00
Kris Kennaway
b26e03e907 Sync with latest KAME
Obtained from:	KAME
2000-07-05 22:09:50 +00:00
Yoshinobu Inoue
93eff08412 Print ifname when sendmsg failed.
Approved by: jkh
2000-02-24 18:46:51 +00:00
Yoshinobu Inoue
b85d5dc850 -P option was not enabled, so enable it
(The option specify IPsec policy for rtadvd to receive Router Renumbering
messages.)

Approved by: jkh
2000-02-15 18:24:27 +00:00
Yoshinobu Inoue
9a4365d0e0 libipsec and IPsec related apps. (and some KAME related man pages)
Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
2000-01-06 12:40:54 +00:00