diff options
| author | Roy Marples <roy@marples.name> | 2013-06-03 06:49:34 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2013-06-03 06:49:34 +0000 |
| commit | 2bf02a2b0b67944a818734261e42369eb35e2fba (patch) | |
| tree | 231b2433e51f70e2cedf81fb5425eff96b456be4 /ipv6.c | |
| parent | 3ea7cb598ff975e7a63b334f69e2508a3b9dbad3 (diff) | |
| download | dhcpcd-2bf02a2b0b67944a818734261e42369eb35e2fba.tar.xz | |
Don't assume the kernel will remove or mark tentative LL addresses.
This isn't a problem as we listen to IPv6 address changes.
Diffstat (limited to 'ipv6.c')
| -rw-r--r-- | ipv6.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -601,22 +601,32 @@ int ipv6_addlinklocalcallback(struct interface *ifp, } void +ipv6_free_ll_callbacks(struct interface *ifp) +{ + struct ipv6_state *state; + struct ll_callback *cb; + + state = IPV6_STATE(ifp); + if (state) { + while ((cb = TAILQ_FIRST(&state->ll_callbacks))) { + TAILQ_REMOVE(&state->ll_callbacks, cb, next); + free(cb); + } + } +} +void ipv6_free(struct interface *ifp) { struct ipv6_state *state; struct ll_addr *ap; - struct ll_callback *cb; + ipv6_free_ll_callbacks(ifp); state = IPV6_STATE(ifp); if (state) { while ((ap = TAILQ_FIRST(&state->ll_addrs))) { TAILQ_REMOVE(&state->ll_addrs, ap, next); free(ap); } - 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; } |
