]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
OpenBSD: Allow dhcpcd to work alongside slaacd
authorRoy Marples <roy@marples.name>
Wed, 26 Sep 2018 12:27:37 +0000 (13:27 +0100)
committerRoy Marples <roy@marples.name>
Wed, 26 Sep 2018 12:27:37 +0000 (13:27 +0100)
Not that you should be doing this, but it appears some people want
two daemons handling the RA.

src/dhcpcd.c
src/if-bsd.c

index 2985ed359248474eb39701a9bbe31f946ecbdd3f..55558c3c23affc9fa925702ae86fa3c45d865b4e 100644 (file)
@@ -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 &&
index cdd959a6a4580977626fd62e49d71cfb9b7f4ad4..c1a6be861a8000b615d06ee8bfa7026b02137e26 100644 (file)
@@ -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;