Commit Graph

169 Commits

Author SHA1 Message Date
mrg cb93b81028 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.
2020-09-06 07:20:26 +00:00
rjs aaf1e01132 Use wrapper name for call to setsockopt(2), NFC for non-rump builds. 2020-08-28 00:19:37 +00:00
christos 32e17edfb9 If we could not lock the pid file, don't continue as we end up with multiple
rtadvd's (thanks roy@)
2020-05-14 23:42:18 +00:00
christos e866966f49 warn only for > INFO level messages. 2020-05-10 22:38:51 +00:00
christos 12aefd6688 Print errors to stderr until we daemonize.
Fix typo.
2020-05-10 22:33:09 +00:00
wiz 7e0632ed7c Remove dst variable that was only set but not used.
(This broke the build for me.)
2020-04-21 12:23:13 +00:00
wiz 0b093b79d0 Update getopt string.
Remove -M. Add -C (the code is there and documented, even if noone could
activate it...).
Sync usage with manpage.
2020-04-21 12:21:27 +00:00
wiz 02044da044 Remove -M from SYNOPSIS as well. 2020-04-21 12:19:44 +00:00
roy ec3335a0cf rtadvd: Remove disabled use of SIOCGIFPREFIX_IN6
It's not been enabled since the functionality was added to ifconfig(8)
many many years ago.
2020-04-21 12:16:47 +00:00
roy afce0d5d3d rtadvd: Remove router renumbering - it's been disable for years 2020-04-21 12:05:54 +00:00
msaitoh 76bb64e370 s/upate/update/ in comment. 2019-12-03 03:25:28 +00:00
roy 8a7de48817 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).
2019-11-11 13:42:49 +00:00
roy 2a93c54144 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.
2019-11-10 21:32:38 +00:00
roy cfe5ae87ad rtadvd: Fix reloading configuration killing interface timers 2019-11-10 21:07:39 +00:00
mrg de11d87641 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."
2019-10-13 07:28:04 +00:00
roy df8c85e9d4 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.
2019-06-14 09:06:45 +00:00
christos 30de70615e - die sooner (if we got interrupted)
- when we finish resending exit.
2019-03-29 21:51:52 +00:00
mrg fbffadb9f8 - 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
2019-02-03 03:19:25 +00:00
christos 0779cbe997 adjust to new expandm. 2019-01-12 19:09:25 +00:00
christos ea179cc7cf use expandm from libwrap. 2019-01-11 20:41:53 +00:00
ozaki-r 4dae353ba2 rtadvd: use %u to print unsigned variables 2018-11-16 08:57:10 +00:00
roy f8583dbb8c 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.
2018-04-24 18:31:48 +00:00
wiz 7734da6b73 Minor improvements. 2018-04-21 09:31:08 +00:00
roy 1aeb87918e Update values from RFC 8319 2018-04-20 16:37:17 +00:00
roy e673cfdc24 Make the #defines more readable 2018-04-20 16:18:18 +00:00
roy 5f8de401f6 Lack of timeout is a programming error, so use an assert in it's place.
While here, improve the error reported if malloc fails.
2018-04-20 16:07:48 +00:00
roy 27e3ea924d Use EXIT_FAILURE instead of an arbtitary number. 2018-04-20 15:59:17 +00:00
roy 5977af5905 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.
2018-04-20 15:57:23 +00:00
roy 086575fefe Ensure that the soliciter list is initialised and freed correctly, even if it's not used yet. 2018-04-20 15:29:19 +00:00
roy 3bff93a23c Allow timers to exist but be inactive.
This will be used in a future commit.
2018-04-20 13:27:45 +00:00
roy 4f44b8a30e Insist on newer socket options. 2018-04-20 11:31:54 +00:00
roy 1abb8a3172 Use pidifle_lock(3) 2018-04-20 11:25:39 +00:00
roy 301a345cbf Punt dead code 2018-04-20 10:43:38 +00:00
roy e4c3b35870 White space police. 2018-04-20 10:39:37 +00:00
roy 7a0904c3ae Fix some unaligned pointer issues. 2018-04-20 10:26:34 +00:00
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