summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-09-01 11:48:21 +0000
committerRoy Marples <roy@marples.name>2016-09-01 11:48:21 +0000
commit4793785b7f24474266d6a5ccd0a253bf54ca09db (patch)
treeedf49c00574c6048bfdc3367f56103fae6dabc25 /ipv6.c
parentf6245ee8b7b46f30db4e2148ce0168ddb3ffcf16 (diff)
downloaddhcpcd-4793785b7f24474266d6a5ccd0a253bf54ca09db.tar.xz
Clear LL callbacks when dropping or freeing addresses.
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipv6.c b/ipv6.c
index 3b8596dd..2cd45be4 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -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);