diff options
| author | Roy Marples <roy@marples.name> | 2016-09-01 11:48:21 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-09-01 11:48:21 +0000 |
| commit | 4793785b7f24474266d6a5ccd0a253bf54ca09db (patch) | |
| tree | edf49c00574c6048bfdc3367f56103fae6dabc25 /ipv6.c | |
| parent | f6245ee8b7b46f30db4e2148ce0168ddb3ffcf16 (diff) | |
| download | dhcpcd-4793785b7f24474266d6a5ccd0a253bf54ca09db.tar.xz | |
Clear LL callbacks when dropping or freeing addresses.
Diffstat (limited to 'ipv6.c')
| -rw-r--r-- | ipv6.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1626,6 +1626,12 @@ ipv6_freedrop(struct interface *ifp, int drop) if ((state = IPV6_STATE(ifp)) == NULL) return; + /* If we got here, we can get rid of any LL callbacks. */ + while ((cb = TAILQ_FIRST(&state->ll_callbacks))) { + TAILQ_REMOVE(&state->ll_callbacks, cb, next); + free(cb); + } + ipv6_freedrop_addrs(&state->addrs, drop ? 2 : 0, NULL); if (drop) { if (ifp->ctx->ipv6 != NULL) { @@ -1635,10 +1641,6 @@ ipv6_freedrop(struct interface *ifp, int drop) } else { /* Because we need to cache the addresses we don't control, * we only free the state on when NOT dropping addresses. */ - while ((cb = TAILQ_FIRST(&state->ll_callbacks))) { - TAILQ_REMOVE(&state->ll_callbacks, cb, next); - free(cb); - } free(state); ifp->if_data[IF_DATA_IPV6] = NULL; eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp); |
