summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-06-03 06:49:34 +0000
committerRoy Marples <roy@marples.name>2013-06-03 06:49:34 +0000
commit2bf02a2b0b67944a818734261e42369eb35e2fba (patch)
tree231b2433e51f70e2cedf81fb5425eff96b456be4 /ipv6.c
parent3ea7cb598ff975e7a63b334f69e2508a3b9dbad3 (diff)
downloaddhcpcd-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.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/ipv6.c b/ipv6.c
index e0014ad0..78e296c3 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -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;
}