Commit Graph

134 Commits

Author SHA1 Message Date
kre
a33d800447 When sending log messages to stderr, append the \n that syslog does not need. 2017-11-25 02:37:04 +00:00
joerg
9a76d3f972 Mark expandm as preserving format strings. 2017-11-06 19:12:23 +00:00
christos
4c18e5f405 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).
2017-11-06 15:15:04 +00:00
christos
837bece478 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..
2017-10-14 19:16:26 +00:00
christos
e68fbebd32 use librumpres 2017-10-10 19:30:41 +00:00
christos
11aeb6ae69 Don't start another copy of rtadvd if one is running. 2017-09-11 14:12:28 +00:00
christos
7931fdd27d KNF, fix time printing formats. 2017-09-11 14:12:07 +00:00
roy
08bcff5614 Use RO_MSGFILTER. 2017-04-11 14:29:23 +00:00
ozaki-r
cd58b07d6c Fix the default value of rltime
According to rtadvd.conf(5), the default value of rltime is 1800 seconds.

PR bin/51994
2017-02-27 05:41:36 +00:00
joerg
f9c2736326 Disable a couple of warnings until further investigation. 2017-01-11 12:19:43 +00:00
christos
6aea766547 need <time.h> for clock_gettime 2017-01-10 21:07:17 +00:00
ozaki-r
0739b470cb 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.
2016-12-16 09:09:38 +00:00
riastradh
ebd94f1f29 Omit needless casts. 2016-06-15 13:57:39 +00:00
riastradh
7554812ac2 No more obvious strict aliasing violations here. 2016-06-15 13:57:26 +00:00
ozaki-r
0bc5ae37c7 Introduce rump.rtadvd
It is used to write ATF tests for RA.

From s-yamaguchi@IIJ.
2015-11-11 07:48:41 +00:00
ozaki-r
cba76b60ed Fix regression on sending RA messages
r1.48 dropped hoplimit cmsg but forgot to adjust cmsg buffer length.

Reported by Timo Buhrmester
2015-06-15 04:15:33 +00:00
roy
9d47679b07 Use %m in syslog(3) instead of %s strerror(3). 2015-06-05 15:41:59 +00:00
roy
54f3dcbf97 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.
2015-06-05 14:15:41 +00:00
roy
76ec1114d0 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).
2015-06-05 14:09:20 +00:00
joerg
33ddbd4a4d Expect long long to be larger than uint32_t and use llabs after casting
the uint32_t.
2014-02-27 17:43:02 +00:00
plunky
bb39753de6 spelling correction - recieved -> received 2014-01-26 08:31:17 +00:00
roy
d87d6793f0 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
2013-07-09 09:34:58 +00:00
roy
aaccc84c03 If we die and there are no timers, just exit. 2013-06-28 07:59:32 +00:00
roy
5bec235cc5 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.
2013-06-27 15:46:40 +00:00
skrll
e30bd26d32 Fix typo. Reported in PR/47823. 2013-05-17 07:53:05 +00:00
christos
0d93f138b3 fix previous. 2013-01-24 19:55:28 +00:00
christos
0d3cde2c88 make it static const 2013-01-24 17:44:59 +00:00
roy
c050bfe509 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.
2012-12-14 09:48:31 +00:00
wiz
7503eaacd8 Formatting nit. 2012-12-13 21:49:38 +00:00
roy
baf998f70e Remove debug stuff. 2012-12-13 15:40:05 +00:00
roy
83ab565911 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
2012-12-13 15:36:35 +00:00
roy
7175086342 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).
2012-12-11 16:37:23 +00:00
joerg
9edf9a0457 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.
2012-08-10 12:10:27 +00:00
msaitoh
ef486fed67 Fix a bug that incorrect RA packet is sent if rtadvd.conf exists.
Fixes PR#46580 reported by Takahiro HAYASHI.
2012-08-08 04:05:26 +00:00
roy
258cf0abec 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.
2012-04-21 12:27:24 +00:00
wiz
1bfb052ed2 - 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.
2012-03-29 18:37:45 +00:00
roy
32e4280f5f Use RT_ADVANCE when available.
Fixes PR/44838
2011-12-12 01:11:33 +00:00
christos
8e4c4c6990 - sprinkle const
- malloc + memset -> calloc
- free + malloc -> realloc
- syslog("%s", strerror(errno)) -> syslog("%m")
2011-12-11 20:44:44 +00:00
joerg
ee8c61bc50 Use __dead. No prototype for main. 2011-12-11 15:25:52 +00:00
roy
4d6bb52603 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.
2011-12-10 19:14:29 +00:00
mrg
75e42fa7da remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
2011-06-20 07:43:56 +00:00
wiz
9505784535 Sort sections. 2011-04-28 12:12:47 +00:00
jakllsch
87dcea5d47 Use documentation prefix.
Drop trailing whitespace.
Remove repeated word.
Bump date.
2009-11-01 15:19:19 +00:00
jakllsch
691255789a Use documentation prefix. 2009-11-01 15:17:59 +00:00
christos
53a85f7e1b add -DROUTEINFO 2009-10-31 22:32:51 +00:00
joerg
f2670f529d Kill -offset without argument. 2009-08-24 09:45:30 +00:00
lukem
d877c4c3c0 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)
2009-04-22 15:23:01 +00:00
lukem
9a5b6d41c6 fix -Wshadow 2009-04-19 08:40:48 +00:00
christos
f1b4e74602 fix format of time_t 2008-12-29 04:01:21 +00:00
gmcgarry
3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00