From: Roy Marples Date: Fri, 14 Aug 2015 22:10:58 +0000 (+0000) Subject: Don't delete dhcpcd assigned IPv6 link-local addresses when releasing X-Git-Tag: v6.9.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd9ae270a9392ddd77caeab21864f6266ffd67e8;p=thirdparty%2Fdhcpcd.git Don't delete dhcpcd assigned IPv6 link-local addresses when releasing leases. Fixes [cc55ecae33]. --- diff --git a/ipv6.c b/ipv6.c index c160c847..8d65420d 100644 --- a/ipv6.c +++ b/ipv6.c @@ -880,17 +880,22 @@ ipv6_freedrop_addrs(struct ipv6_addrhead *addrs, int drop, { if (drop == 2) TAILQ_REMOVE(addrs, ap, next); - /* Find the same address somewhere else */ - apf = ipv6_findaddr(ap->iface->ctx, &ap->addr, 0); - if (apf == NULL || - (apf->iface != ap->iface)) - ipv6_deleteaddr(ap); - if (!(ap->iface->options->options & - DHCPCD_EXITING) && apf) - { - if (!timespecisset(&now)) - clock_gettime(CLOCK_MONOTONIC, &now); - ipv6_addaddr(apf, &now); + /* Don't drop link-local addresses. */ + if (!IN6_IS_ADDR_LINKLOCAL(&ap->addr)) { + /* Find the same address somewhere else */ + apf = ipv6_findaddr(ap->iface->ctx, &ap->addr, + 0); + if ((apf == NULL || + (apf->iface != ap->iface))) + ipv6_deleteaddr(ap); + if (!(ap->iface->options->options & + DHCPCD_EXITING) && apf) + { + if (!timespecisset(&now)) + clock_gettime(CLOCK_MONOTONIC, + &now); + ipv6_addaddr(apf, &now); + } } if (drop == 2) ipv6_freeaddr(ap);