summaryrefslogtreecommitdiff
path: root/usr.sbin/rtadvd
AgeCommit message (Collapse)Author
2016-09-26Exit early from rdaemon() is the passed fd is invalid.Jeremie Courreges-Anglas
fd == -1 check suggested by deraadt@, ok florian@
2016-09-25consistently use MAX_ prefixFlorian Obser
OK jca
2016-09-25Interval calculations are perfectly fine with ints.Florian Obser
OK jca@
2016-09-21Use a properly aligned buffer (malloc'd, not on stack) to get routing messages.Jeremie Courreges-Anglas
This fixes rtadvd on (at least) armv7. Problem reported and fix tested by Martin Brandenburg.
2016-09-21Use the correct local variable to get address & prefixlen in routing messagesJeremie Courreges-Anglas
This currently has no effect because route sockets are datagram (PR_ATOMIC) sockets, so we only get one message at a time. This means that the parsing code could be simplified. route(4) sockets cluebat from claudio@
2016-09-15Go in the background later, using rdaemon().Jeremie Courreges-Anglas
rdaemon() works like daemon(3) but requires its caller to pre-open /dev/null. This makes it possible to go in the background after a chroot(2), allowing for more error checking. The pattern is basically - open /dev/null - chroot - privdrop - rdaemon "design" initialy discussed with semarie@ a while ago, ok dlg@
2016-09-03typosJeremie Courreges-Anglas
2016-08-25Fix rtadvd.conf(5) example for pinfoflags, it accepts numbers not strings.Stuart Henderson
ok phessler
2016-08-20Tweak timer debug output.Jeremie Courreges-Anglas
-RA timer on em0 is set to 16:0 +RA timer on em0 is set to 16.0s
2016-08-20Move counters from u_quad_t to uint64_t.Jeremie Courreges-Anglas
Printing is already done with %llu/(unsigned long long) casts.
2016-08-02Move to libevent; ok florian@Jeremie Courreges-Anglas
2016-06-30Prevent NULL deref, pointed out by llvm's scan-build.Florian Obser
OK jca, millert
2016-06-29Spring cleanupJeremie Courreges-Anglas
- pointless casts, kill caddr_t or replace it with char * - signed counters - simplify if_getmtu, only one method is needed and SIOCGIFMTU is the cheapest - we no longer have drivers for IFT_FDDI - hide details of iflist management - if (dflag) log_debug -> log_debug - dead code and comments - etc etc Input from and ok florian@
2016-05-07Replace .Po/.Pc with .Pq, and drop extra .Li; suggested by jmc@Jeremie Courreges-Anglas
2016-05-07Document that both raflags and rtflags can hold route preference flags.Jeremie Courreges-Anglas
Input from an ok jmc@
2016-03-01fatal("malloc") -> fatal(NULL)Jeremie Courreges-Anglas
2016-03-01Pointless 'return;' in void functionsJeremie Courreges-Anglas
2016-03-01Kill unused #definesJeremie Courreges-Anglas
No functional change
2016-02-29Merge add/make_prefix() and kill last use of struct in6_prefixreq in userland.Jeremie Courreges-Anglas
ok florian@
2016-02-29init_prefix() is now trivial, merge it with its caller.Jeremie Courreges-Anglas
Suggested by and ok bluhm@
2016-02-26sys/signal.h -> signal.hJeremie Courreges-Anglas
2016-02-26Unused variable.Jeremie Courreges-Anglas
2016-02-26GC remnants of the Router Renumbering code; ok florian@Jeremie Courreges-Anglas
2016-02-26Remove #if'0ed code that uses a deprecated ioctl; ok florian@Jeremie Courreges-Anglas
2016-02-26Kill some useless members of struct rainfo; ok florian@Jeremie Courreges-Anglas
2016-02-09another typoJeremie Courreges-Anglas
2016-02-09Kill code to send unicast packets which never got enabled.Jeremie Courreges-Anglas
and get rid of pointless memory allocations. ok bluhm@
2016-02-08Kill trailing whitespace.Jeremie Courreges-Anglas
2016-02-08typosJeremie Courreges-Anglas
2016-02-08Print MAX addresses padded with a leading zero.Jeremie Courreges-Anglas
2016-02-07Mark a few others functions as __dead; ok bluhm@Jeremie Courreges-Anglas
2016-02-05select -> poll in log message; ok bluhm@ florian@Jeremie Courreges-Anglas
2016-02-05Bail out if an unknown option is passed.Jeremie Courreges-Anglas
There is no reason for rtadvd to be different from other daemons. Input from and ok bluhm@ florian@
2016-02-05rtadvd used a strncpy with a src interface name from the command lineReyk Floeter
without checking its length. Replace it with strlcpy, check for truncation and move the check before using the user-specified interface name. While here, replace another strncpy of a interface name with memset-zero + strlcpy and check for truncation in if_getmtu() (should not happen as we validated the length before, but it's better to be safe and generally a better practice). OK jsg@
2016-01-25Redundant assignement is redundant.Jeremie Courreges-Anglas
2015-12-11Remove NULL-checks before free().mmcc
2015-12-01Use setsockopt(ROUTE_MSGFILTER) instead of hand-rolled filtering.Jeremie Courreges-Anglas
ok florian@
2015-12-01This RTM_GET case can't trigger due to the filtering done above.Jeremie Courreges-Anglas
ok florian@
2015-11-30Kill Mobile IPv6 references. Also spotted by florian@Jeremie Courreges-Anglas
2015-11-30Clean up get_next_msg(): kill dead argument/codeJeremie Courreges-Anglas
The "ifindex" argument has always been zero, making the interface index checks within get_next_msg() useless. The caller already properly retrieves and handle the interface index of the routing messages. ok florian@
2015-11-30Remove the already disabled Router Renumbering support (RFC2894).Jeremie Courreges-Anglas
This code has only been reachable for two months after rtadvd has been imported into the tree. This unsafe protocol is supposed to be used along with IPsec and rrenumd(8), a KAME tool that we don't have. I couldn't find an example of use in the real world. ok sthen@ florian@ millter@
2015-11-30Fix dynamic prefix tracking.Jeremie Courreges-Anglas
This code should not be using RTAX_GATEWAY to retrieve the interface index. Also this index is meaningless within get_next_msg(), further cleanup is planned. Issue reported by Sly Midnight on bugs@, ok mpi@
2015-11-03Recognize carp(4) interfaces (yes, they are special...) in order to sendMartin Pieuchot
the src lladdr option. Problem reported and diff provided by Lauri Tirkkonen on bugs@ ok sthen@
2015-10-25In case of error, also log the file name we failed to open.Jeremie Courreges-Anglas
2015-10-25ansifyJeremie Courreges-Anglas
2015-10-25pledge "stdio inet route"; ok deraadt@Jeremie Courreges-Anglas
2015-10-25Stop writing down a pidfile.Jeremie Courreges-Anglas
pid files aren't useful on OpenBSD, the rc.d(8) framework doesn't use them. In rtadvd, not writing a pid file means that we can set tighter pledge(2) settings. Also the pid file handling is pretty basic and the atexit handler can't remove the pid file since rtadvd did a chroot - beurk. ok florian@, "perfect" deraadt@ (!)
2015-08-20stdlib.h is in scope; do not cast malloc/calloc/realloc*Theo de Raadt
ok millert krw
2015-08-18Fix inconsistent spelling of `inconsistent'Miod Vallat
2015-06-03Do not assume that asprintf() clears the pointer on failure, whichTodd C. Miller
is non-portable. Also add missing asprintf() return value checks. OK deraadt@ guenther@ doug@