summaryrefslogtreecommitdiff
path: root/sbin/slaacd
AgeCommit message (Collapse)Author
2022-01-04Wait for the link-local address to become non-tentative.Florian Obser
Otherwise we just end up with an ugly "Can't assign requested address" error from sendmsg(2). OK phessler
2022-01-03Prefix life time is independent from router life time.Florian Obser
Form an IPv6 address even if the router announcing the prefix isn't a default router. Problem reported by mgraves AT brainfat.net on misc OK denis
2021-12-27knfFlorian Obser
2021-12-13including sys/cdefs.h manually started as a result of netbsd trying toTheo de Raadt
macro-build a replacement for sccsid, and was done without any concern for namespace damage. Unfortunately this practice started infecting other code as others were unaware they didn't need the file. ok millert guenther
2021-11-28Make sure the interface still exists before updating it.Florian Obser
When we get a route message, for example an address being added (RTM_NEWADDR, but the problem exists with most of the route messages) and the interface gets unplugged at just the right moment if_nametoindex(3) will return NULL. We will pass NULL through update_iface() to get_xflags() which will then crash because we dereference the NULL pointer there. OK kn
2021-11-28Make sure if_index is set in all case statements and use itFlorian Obser
consistently. This makes the next diff easier, also consistency is good. OK kn
2021-08-24When an interface disappears, e.g. when a usb dongle gets unplugged,Florian Obser
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message. Handle this message to not accumulate "unknown" interfaces. While here fix a bug where we would remove an interface only in the engine process but not in the frontend when an interfaces gets unplugged while we process a RTM_IFINFO message for it. OK benno
2021-07-27The SIOCAIFADDR_IN6 ioctl could lose a race against another processFlorian Obser
configuring the same IP. I forgot to fix slaacd after fixing the same problem in dhcpleased. Pointed out by afresh1
2021-07-22Send rDNS proposals on ramdiskskn
Otherwise resolvd(8) will never learn nameservers and update /etc/resolv.conf with IPv6 resolvers. At the moment IPv6 only installations always prompt for nameservers anyway, but that is its own bug and will be fixed soon. This enables the upcoming fix to detect learned nameservers in the first place. Feedback OK florian
2021-07-21Use exclusive lock under /dev/, silence expected errors in installerkn
resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons in that there must only be a single instance. resolvd already does this, adjust slaacd and dhcpleased accordingly while moving the lockfile paths under /dev/ such that they work early on boot and don't run into races should /var be (un)mounted between daemon starts. Locking is especially required in the installer where all three daemons are started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? " prompt is entered, i.e. restarting installation or dropping into a shell and back into the prompt again would start multiple instances. To avoid expected lockfile error messages in between installer prompts, discard standard error when starting the autoconf daemons; none of them has other potential failure cases in installer mode before daemon(3)izing. Input sthen deraadt OK deraadt
2021-07-12Change the error reporting pattern throughout the tree when unveilBob Beck
fails to report the path that the failure occured on. Suggested by deraadt@ after some tech discussion. Work done and verified by Ashton Fagg <ashton@fagg.id.au> ok deraadt@ semarie@ claudio@
2021-05-01In singel user mode / is mounted ro. Just warn if we can't createFlorian Obser
the control socket instead of fatal(). OK deraadt
2021-05-01Allow running in single user mode where /var/empty doesn't exist byFlorian Obser
switching from chroot("/var/empty") to unveil("/", ""). This is just an extra pair of suspenders since these processes pledge(2) to not access the filesystem. OK deraadt
2021-03-21Use new terminology of RFC 8981 and (mechanically) replace "privacy"Florian Obser
with "temporary".
2021-03-21Don't warn that we can't form a temporary address when a routerFlorian Obser
deprecates a prefix by sending a pltime of 0, this is normal. Continue warning when the pltime is smaller than 5 as this is almost certainly a configuration error. Found the hard way by & OK otto.
2021-03-20RFC 8981 allows the configuration of only temporary IPv6 addresses.Florian Obser
Track autoconf and temporary flag individually to be able to support this. OK kn
2021-03-20Fix SMALL build when done from sbin/slaacdkn
distrib/special/slaccd is the actual SMALL user but having it build from here is useful, too; in fact, it showed some more unused variables under SMALL. OK florian
2021-03-11When RFC 8981 obsoleted RFC 4941 the terminology changed fromFlorian Obser
"privacy extensions" to "temporary address extensions" Change ifconfig(8) to output temporary after temporary addresses and add "temporary" option which is an alias for autoconfprivacy for now. Also make AUTOCONF6TEMP a positiv flag that is set by default. Previously the negative flag "INET6_NOPRIVACY" was set when privacy addresses were disabled. This makes the flags output less ugly and will allow us to disable autoconf addresses while having temporary addresses enabled in the future. More work is needed in slaacd. input benno, jmc, deraadt previous verison OK benno OK jmc, kn
2021-03-07Withdraw nameservers when the interface goes down.Florian Obser
Problem reported by deraadt some time ago.
2021-03-07Fold get_lladdr into update_iface, now the only caller.Florian Obser
This allows us to pass the link state over to engine here instead of in update_addr which is not available in small. This gets us more in line dhcpleased.
2021-03-07No need to pass the link local and hw address around, we have itFlorian Obser
already in the interface on the engine side.
2021-03-07reshuffle to bring more in line with dhcpleasedFlorian Obser
2021-03-07Introduce engine_update_if().Florian Obser
This was too much code in the imsg handler.
2021-03-06Implement last remaining bits to update from RFC 4941 to RFC 8981.Florian Obser
The desync factor is now tracked per temporary IP and the max value has been increased to about 9 hours. While here fix a bug where the minimum acceptable pltime in a router advertisement should be bigger than PRIV_REGEN_ADVANCE not the desync factor (which didn't make any sense at all). From Fernando Gont, thanks! OK sthen
2021-03-02Fix indentation of switch / case. No binary change.Florian Obser
2021-03-02remove uneeded md5.h includeJonathan Gray
ok florian@
2021-02-27Path #defines are traditionally prefixed with _PATH.Florian Obser
pointed out by deraadt
2021-02-26remove some unused functions in slaacdJonathan Gray
ok florian@
2021-01-19Make imsg event structs static to fix -fno-common.Florian Obser
Follows claudio's lead in ospfd et al. Problem reported by mortimer.
2021-01-19Move control_state and ctl_conns to control.c, it's not neededFlorian Obser
elsewhere and unbreaks -fno-common. Inspired by claudio Problem reported by mortimer
2021-01-19No need for a global slaacd_process; unbreaks -fno-common.Florian Obser
Problem reported by mortimer
2021-01-17Mark up locations of KAME hack with #ifdef __KAME__ so that we canFlorian Obser
find it again if and when we no longer need it. No object change.
2021-01-16Oops, fix previous.Florian Obser
We only want to recover the scope id if it hasn't already been recovered. But we want to always copy the link-local address.
2021-01-16Only recover the KAME embedded scope if the sin6_scope_id is notFlorian Obser
initialized. If it is set assume the scope was already recovered. OK bluhm, claudio
2020-12-29getifaddrs() can return entries where ifa_addr is NULL. Check for thisSebastian Benoit
before accessing anything in ifa_addr. florian@ mentioned this might be a problem in slaacd(8) and rad(8) after claudio@ fixed it in bgpd, so i went looking...
2020-12-01Sync get_ifrdomain() to rad(8) version by removing a useles (void)Florian Obser
cast in front of a strlcpy(3). tb@ had pointed out that the use in rad(8) was not consistent. I consider the void cast a useless annotation, either the strl* functions must have the canonical trucation check or it must be obvious that truncation cannot happen or is not a problem. While at it remove a bunch more casts that snuck in over time.
2020-11-29Fix previous; we need to set the icmp6ev in the interface to NULLFlorian Obser
otherwise we are referencing the wrong one when the rdomain changes. Sorry for not spotting it earlier.
2020-11-28improve legibility of the newly introduced unref_icmp6ev() before thisChristian Weisgerber
code gets copied around; ok florian@
2020-11-28An interface might have disappeared or switched rdomains while weFlorian Obser
waited for a FD. It's not a fatal condition if it arrives late. OK tb
2020-11-28Reduce code duplication by introducing unref_icmp6ev().Florian Obser
OK tb
2020-11-28Handle the case of an autoconf interface changing its rdomain.Florian Obser
To avoide code duplication have get_icmp6ev_by_rdomain() either return an existing icmp6ev in the correct rdomain or allocate one. OK tb
2020-10-30Track creation time of address proposals to be able to establish totalFlorian Obser
lifetime. Use this information to renew pltime / vltime of privacy addresses for up to 1 day / 2 days as RFC 4941. This is important when announced pltime / vltime is lower than 1 day / 2 days, privacy addresses would have expired too fast. Spotted after a remark by Fernando Gont on misc@
2020-10-30If Duplicate Address Detection (DAD) fails only generate a new addressFlorian Obser
if we are using Semantically Opaque Interface Identifiers (soii) otherwise we would just create the same address again and DAD will fail again.
2020-10-30Follow RFC 4941 and calculate the desync_factor at startup.Florian Obser
There is probably nothing wrong with calculating a new random value everytime we create an address, but we are also not gaining anything. Makes math in upcomming diffs easier.
2020-10-30Since the RFC 4941 constants are no longer in a public headerFlorian Obser
(netinet6/nd6.h) we can remove the ND6 prefix. While here use a MAX_DESYNC_FACTOR of 10 minutes as the RFC specifies. We are using arc4random_uniform which avoids modulo bias.
2020-10-30Pull check for duplicate address up to skip them early, we are notFlorian Obser
going to renew them. Avoids redundant check for privacy addresses.
2020-10-30update_iface_ra does too much, move prefix handling into function.Florian Obser
2020-10-30update_iface_ra does too much, move dfr handling into function.Florian Obser
2020-10-30update_iface_ra does too much, move rdns handling into function.Florian Obser
2020-09-17With the multi rdomain support, slaacd now sees all icmpv6 packets andSebastien Marie
filters in userland. But the packet type check was placed at the wrong place so the hoplimit check was done against every icmpv6 packet but no all of them have a hoplimit constraint. tested and ok by me, committed on behalf of florian@