diff options
| author | Roy Marples <roy@marples.name> | 2015-08-14 22:10:58 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2015-08-14 22:10:58 +0000 |
| commit | cd9ae270a9392ddd77caeab21864f6266ffd67e8 (patch) | |
| tree | 0064f9bd3fad1634a9c8cb2585a7fc45f65e41da /ipv6.c | |
| parent | 2fd7df0d04b54e25e1e155ab690f39398fa1a2d4 (diff) | |
| download | dhcpcd-cd9ae270a9392ddd77caeab21864f6266ffd67e8.tar.xz | |
Don't delete dhcpcd assigned IPv6 link-local addresses when releasing
leases.
Fixes [cc55ecae33].
Diffstat (limited to 'ipv6.c')
| -rw-r--r-- | ipv6.c | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -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); |
