From 5b31e323a0e8fed63b65d8b9027d9b93ca9560cb Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 26 Sep 2018 13:27:37 +0100 Subject: [PATCH] OpenBSD: Allow dhcpcd to work alongside slaacd Not that you should be doing this, but it appears some people want two daemons handling the RA. --- src/dhcpcd.c | 4 ++++ src/if-bsd.c | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 2985ed35..55558c3c 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -451,6 +451,10 @@ configure_interface1(struct interface *ifp) ifo->options &= ~(DHCPCD_IPV6RS | DHCPCD_DHCP6 | DHCPCD_WAITIP6); + if (!(ifo->options & DHCPCD_IPV6RS)) + ifo->options &= + ~(DHCPCD_IPV6RA_AUTOCONF | DHCPCD_IPV6RA_REQRDNSS); + /* We want to setup INET6 on the interface as soon as possible. */ if (ifp->active == IF_ACTIVE_USER && ifo->options & DHCPCD_IPV6 && diff --git a/src/if-bsd.c b/src/if-bsd.c index cdd959a6..c1a6be86 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -1393,8 +1393,20 @@ set_ifxflags(int s, const struct interface *ifp) /* * If not doing autoconf, don't disable the kernel from doing it. * If we need to, we should have another option actively disable it. + * + * OpenBSD moved from kernel based SLAAC to userland via slaacd(8). + * It has a similar featureset to dhcpcd such as stable private + * addresses, but lacks the ability to handle DNS inside the RA + * which is a serious shortfall in this day and age. + * Appease their user base by working alongside slaacd(8) if + * dhcpcd is instructed not to do auto configuration of addresses. */ - if (ifp->options->options & DHCPCD_IPV6RS) +#if defined(ND6_IFF_ACCEPT_RTADV) +#define BSD_AUTOCONF DHCPCD_IPV6RS +#else +#define BSD_AUTOCONF DHCPCD_IPV6RA_AUTOCONF +#endif + if (ifp->options->options & BSD_AUTOCONF) flags &= ~IFXF_AUTOCONF6; if (ifr.ifr_flags == flags) return 0; -- 2.47.3