summaryrefslogtreecommitdiffstats
path: root/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-08-05 12:56:02 +0000
committerRoy Marples <roy@marples.name>2016-08-05 12:56:02 +0000
commit1bbf5c3d6e1e880398ebeff547407e13624499f2 (patch)
treeba9a3436521d2c4c6e778ff3f6dc6bb474107703 /if-bsd.c
parent19024074413d39af6a7722e4b9892efe4d6aebcd (diff)
downloaddhcpcd-1bbf5c3d6e1e880398ebeff547407e13624499f2.tar.xz
Note that the prior issue was fixed in OpenBSD-5.9
Diffstat (limited to 'if-bsd.c')
-rw-r--r--if-bsd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/if-bsd.c b/if-bsd.c
index 3a91a49d..bc473461 100644
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -941,6 +941,8 @@ if_address6(unsigned char cmd, const struct ipv6_addr *ia)
ipv6_mask(&mask, ia->prefix_len);
ADDADDR(&ifa.ifra_prefixmask, &mask);
+#undef ADDADDR
+
/*
* Every BSD kernel wants to add the prefix of the address to it's
* list of RA received prefixes.
@@ -955,7 +957,7 @@ if_address6(unsigned char cmd, const struct ipv6_addr *ia)
* constantly removing the prefix route dhcpcd is capable of adding
* in it's absense.
*
- * What we can do to mitigate the issue is to add the adress with
+ * What we can do to mitigate the issue is to add the address with
* infinite lifetimes, so the prefix route will never time out.
* Once done, we can then set lifetimes on the address and all is good.
* The downside of this approach is that we need to manually remove
@@ -964,16 +966,19 @@ if_address6(unsigned char cmd, const struct ipv6_addr *ia)
*
* This issue is discussed on the NetBSD mailing lists here:
* http://mail-index.netbsd.org/tech-net/2016/08/05/msg006044.html
+ *
+ * Fixed in OpenBSD-5.9
*/
+#if !(defined(OpenBSD) && OpenBSD >= 201605)
if (cmd == RTM_NEWADDR && !(ia->flags & IPV6_AF_ADDED)) {
ifa.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
ifa.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
(void)ioctl(priv->pf_inet6_fd, SIOCAIFADDR_IN6, &ifa);
}
+#endif
ifa.ifra_lifetime.ia6t_vltime = ia->prefix_vltime;
ifa.ifra_lifetime.ia6t_pltime = ia->prefix_pltime;
-#undef ADDADDR
return ioctl(priv->pf_inet6_fd,
cmd == RTM_DELADDR ? SIOCDIFADDR_IN6 : SIOCAIFADDR_IN6, &ifa);