summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-09-19 17:51:04 +0000
committerRoy Marples <roy@marples.name>2016-09-19 17:51:04 +0000
commitb0c92d68cca7b0c57dbb47b52fd09b38d7bc1086 (patch)
tree87ac084e2e84a8f3b7b7c81bd6780685228a0f85 /ipv6.c
parent2e6a84de127558ff807c093f07363cd2914ad18c (diff)
downloaddhcpcd-b0c92d68cca7b0c57dbb47b52fd09b38d7bc1086.tar.xz
Add CAN_DROP_LLADDR so we can easily handle our current inability to remove the IPv6 LL address on Solaris
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/ipv6.c b/ipv6.c
index 9cdc2e91..17a2394d 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -104,17 +104,27 @@
/* If we're using a private SLAAC address on wireless,
* don't add it until we have associated as we randomise
* it based on the SSID. */
-#define CAN_ADD_LLADDR(ifp) \
+#define CAN_ADD_LLADDR(ifp) \
(!((ifp)->options->options & DHCPCD_SLAACPRIVATE) || \
(ifp)->carrier != LINK_DOWN)
+#ifdef __sun
+/* Although we can add our own LL addr, we cannot drop it
+ * without unplumbing the if which is a lot of code.
+ * So just keep it for the time being. */
+#define CAN_DROP_LLADDR(ifp) (0)
+#else
+#define CAN_DROP_LLADDR(ifp) (1)
+#endif
#elif __NetBSD__
/* Earlier versions of NetBSD don't add duplicate LLADDR's if the interface
* is brought up and one already exists. */
-#define CAN_ADD_LLADDR(ifp) (1)
+#define CAN_ADD_LLADDR(ifp) (1)
+#define CAN_DROP_LLADDR(ifp) (1)
#else
/* We have no control over the OS adding the LLADDR, so just let it do it
* as we cannot force our own view on it. */
-#define CAN_ADD_LLADDR(ifp) (0)
+#define CAN_ADD_LLADDR(ifp) (0)
+#define CAN_DROP_LLADDR(ifp) (0)
#endif
#ifdef IPV6_MANAGETEMPADDR
@@ -1009,8 +1019,8 @@ ipv6_freedrop_addrs(struct ipv6_addrhead *addrs, int drop,
(DHCPCD_EXITING | DHCPCD_PERSISTENT))
{
/* Don't drop link-local addresses. */
- if (!(IN6_IS_ADDR_LINKLOCAL(&ap->addr) &&
- CAN_ADD_LLADDR(ap->iface)))
+ if (!IN6_IS_ADDR_LINKLOCAL(&ap->addr) ||
+ CAN_DROP_LLADDR(ap->iface))
{
if (drop == 2)
TAILQ_REMOVE(addrs, ap, next);