summaryrefslogtreecommitdiff
path: root/sbin/slaacd
AgeCommit message (Collapse)Author
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-27let free_address_proposal() handle the LIST_REMOVE, like free_dfr_proposal()Florian Obser
2019-06-27free_dfr_proposal() does the LIST_REMOVE for us; do not run it twiceFlorian Obser
2019-06-07Reyk's ISP sends him router advertisements from non-link localFlorian Obser
addresses about every 10 - 30 seconds. Reduce log level to debug to stop the syslog spam. OK reyk
2019-03-31Avoid calling dup2(oldd, newd) when oldd == newd. In that case theYASUOKA Masahiko
descriptor keeps CLOEXEC flag then it will be closed unexpectedly by exec(). ok tedu florian
2019-03-15Do not accept a control socket if we already have one.Florian Obser
OK pamela
2019-03-11Make slaacd(8) imsg processing more paranoid. Unexpected size mismatchespamela
mean we should no longer trust processes, so we call fatal(x). The control socket is the exception, where we ignore rather than allow crashes due to data from the outside. suggestion/input and OK florian@
2019-03-11Change fatal() to fatalx() where errno is not set.pamela
input and OK florian@
2019-03-11While strtonum(3) does set errno, we already use errstr to show what'sFlorian Obser
going on so use log_warnx to not print a useless 2nd error message. OK pamela
2019-03-05slaacd doesn't have a config file to reload on hangup. We can ignorepamela
those signals, so remove unnecessary signal handling code. pointed at and OK florian@
2019-03-02Introduce the IMSG_DATA_SIZE() macro to replace recurring math onpamela
imsg.hdr.len to shorten and simplify code. correction and OK florian@
2019-03-01trailing whitespaceFlorian Obser
2019-01-22PF_ROUTE -> AF_ROUTE in the scattered sock()/setsockopt() callsKenneth R Westerback
where the "wrong" #define was used. ok dlg@
2018-08-19Call daemon with 0 as first argument so that it changes the cwd to /Florian Obser
otherwise the main process will keep sitting in the directory from where slaacd was started which might for example prevent an unmount. Problem first observed by dlg in ntpd(8). Discussed with deraadt@
2018-08-05Since -s argument is no longer checked, during reexec, the argv size then mustRicardo Mestre
be shortened by 1. OK florian@
2018-08-04Leave the control socket behind on shutdown. It doesn't hurt anyone.Florian Obser
On the other hand it is much more powerful to get rid of cpath; slaacd has no filesystem access whatsoever. Triggered by mestre@'s work to fix unlinking in other daemons and a question from deraadt@ OK mestre
2018-07-27Have slaacd(8) share information on receiving a MTU advertisement withbket
slaacctl(8). OK florian@
2018-07-27Enable slaacd(8) to set MTU on an interface.bket
If a router advertisement message with the MTU option is received on an interface slaacd will set the specified MTU on that interface. Lots of help from florian@. Thank you! OK florian@
2018-07-23When moving between networks slaacd configures new addresses butFlorian Obser
leaves old ones behind. The IPv6 RFCs don't seem to offer guidance on what to do in this case. (RFC 5220 discusses related issues, but not exactly this.) It seems a bit harsh to just delete old addresses - a naive implementation can easily lead to flip-flopping between two prefixes. Instead set the preferred lifetime to 0 for all addresses on an interface when the link goes down, thus marking addresses as deprecated but still usable. When the link comes back send a router solicitation. If we are still on the old network and receive a router advertisement the preferred lifetime will increase and the addresses will no longer be deprecated. If we moved to a new network we will get new router advertisements and form new addresses. The old ones will stay deprecated and the address selection algorithm will prefer new addresses. Problem reported by many. testing & OK phessler
2018-07-23replace references to rtadvd(8) with rad(8)Florian Obser
OK deraadt, phessler, jmc
2018-07-23Handle duplicate address detection failures.Florian Obser
We get notified when duplication is detected on the route socket. For privacy addresses simply generate a new random address. If we have soii enabled increase the dad counter on the prefix and generate a new address. For eui64 addresses nothing can be done.
2018-07-09Remove array of IMSG type names.Florian Obser
It was helpfull in the beginning to know which IMSG are flying around but unusable (and unsused) since slaacd(8) is on the ramdisk.
2018-07-07slaacd is not interested in v4-related route messages so set the addressStuart Henderson
family on the two socket() calls to open the routing socket, so that only v6-related and af-unspecific messages are seen. One of the sockets is only used for sending not receiving messages; shutdown the receive side to avoid receiving messages as suggested by claudio@. slaacd is run by default (watching for interface changes to add the "autoconf" flag), so has to process route messages even where IPv6 autoconf isn't used - these changes reduce CPU use on machines processing large numbers of route updates (in particular full-table BGP routers). ok florian@ claudio@ benno@
2018-06-20This might have been a good idea 20 years ago but in this day and ageFlorian Obser
the compiler is probably better at unrolling loops. style nit fcambus OK phessler
2018-06-18Pledge main process now that we have wroute.Florian Obser
2018-06-07put ".Re" in the right place;Jason McIntyre
2018-06-06RFC 8106 obsolteted RFC 6106.Florian Obser
From brad@, OK jmc
2018-06-06After pledge the frontend process is only accepting fromFlorian Obser
an AF_UNIX socket (the control socket) so replace inet with unix pledge.
2018-05-26Add more RFCs; found while preparing BSDCan slides.Florian Obser
2018-05-18merge two ifndef small blocks; no functional changeFlorian Obser
2018-05-18dead stores; from llvm scan-buildFlorian Obser
2018-05-18typo, pointed out by llvm scan-build, how did this even work though?Florian Obser
2018-05-17Handle RTM_DELETE of slaacd managed default route by re-inserting it.Florian Obser
Problem pointed out & OK phessler
2018-05-17Fully align this with route(8); no need to be different here and mightFlorian Obser
help us if we ever get rid of KAME hack.
2018-05-17Introduce SLAACD_RTA_LABEL define to not use a string constant allFlorian Obser
over the place.
2018-05-16Create all sockets with SOCK_CLOEXEC, we never want to hold on to themFlorian Obser
over execve(2).
2018-05-15typo in log messageFlorian Obser
2018-05-12log_procnames[] needs to be in sync with slaacd_process enum otherwiseFlorian Obser
processes have the wrong process title leading to confusion.
2018-05-02sort;Jason McIntyre
2018-05-01Mention RFC 7217 and RFC 7772Florian Obser
2018-04-26Add error handling to unconfuse myself when playing with pledgepath().Florian Obser
2018-04-26The frontend tells the main process when the startup is finished soFlorian Obser
that we can drop the sendfd pledge.
2018-04-26Hoist initialisations up; while here tighten not yet working pledge.Florian Obser
2018-04-23While privacy addresses do just expire and never get renewed we needFlorian Obser
to solicit a router advertisment shortly before their pltime runs out so that we generate a new one. Reported by naddy@. OK benno@
2018-03-13RFC 7217 states (section 5, page 9):Florian Obser
| The Interface Identifier is finally obtained by taking as many | bits from the RID value (computed in the previous step) as | necessary, starting from the least significant bit. Copy bits from the end of the digest array, not from the beginning. While here initialize iid. Problem that IPv6 addresses change while they should not pointed out by semarie@. OK sthen, phessler
2018-03-08Back in the history of time, IPv4 had classes of addresses. This was widelyPeter Hessler
acknowledged as a failure. At the same time IPv4 classes were declared a failure, IPv6 decided to add them back because using a mac address for IP address configuration was easy. Now that we have RFC7217 support we can remove this artificial limitation: allow non-/64 prefixes to be configured by SLAAC. Of course, if you have fewer bits for the hosts part of the address you have fewer bits for privacy and fewer bits to avoid collisions. OK florian@
2018-03-07RFC 7136 clarifies that the "u" and "g" bits are only significant whenFlorian Obser
IPv6 unicast interface identifiers are derived from IEEE link-layer addresses. In all other cases the interface identifier should be treated as an opaque value. Accordingly stop fiddling with the bits for privacy addresses. While here initialize the whole priv_in6 struct with random data, currently no functional change but reduces amount of magic numbers, pointed out by phessler as part of a larger diff. OK phessler, sthen
2018-02-20make sure we've read the lenght bytes before checking the lengthOtto Moerbeek
ok benno@
2018-02-19(static) byte buffers are not aligned in any way, malloc the buffer toOtto Moerbeek
solve that. Prevents bus error on armv7. ok naddy@ florian@
2018-02-10RFC 7217 support for slaacdFlorian Obser
OK naddy, sthen