From: Roy Marples Date: Wed, 22 May 2013 18:16:32 +0000 (+0000) Subject: Fix compile on FreeBSD X-Git-Tag: v5.99.7~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c80d49c4475816143587e0884cb0c5d39939acd;p=thirdparty%2Fdhcpcd.git Fix compile on FreeBSD Document why we don't set IN6_IFF_TENTATIVE when adding addresses and a possible error on FreeBSD. --- diff --git a/if-bsd.c b/if-bsd.c index 81632a97..f7f0741f 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -311,7 +311,15 @@ if_address6(const struct interface *ifp, const struct ipv6_addr *a, int action) return -1; memset(&ifa, 0, sizeof(ifa)); strlcpy(ifa.ifra_name, ifp->name, sizeof(ifa.ifra_name)); - ifa.ifra_flags = IN6_IFF_TENTATIVE; + /* + * We should not set IN6_IFF_TENTATIVE as the kernel should be + * able to work out if it's a new address or not and set it accordingly + * although FreeBSD seems to be buggy here. + * + * We should set IN6_IFF_AUTOCONF, but the kernel won't let us. + * This is probably a safety measure, but still it's not entirely right + * either. + */ #if 0 if (a->autoconf) ifa.ifra_flags |= IN6_IFF_AUTOCONF; diff --git a/net.c b/net.c index ef5ab5d1..c090e05d 100644 --- a/net.c +++ b/net.c @@ -34,6 +34,7 @@ #include #ifdef AF_LINK # include +# include # include # include #endif diff --git a/net.h b/net.h index 3394ba14..50c8f3c4 100644 --- a/net.h +++ b/net.h @@ -28,6 +28,8 @@ #ifndef INTERFACE_H #define INTERFACE_H +#include + #include #include #include