summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-04-11 16:04:08 +0000
committerbz <bz@FreeBSD.org>2010-04-11 16:04:08 +0000
commitd7a91dc6bf166a266421facb5e7cc8067695b03b (patch)
tree62a56a95d03df4cca3ba14e6c3cae4d3f5a44931 /sys/net
parent63955b94c288cde6ff80eaba0accf6043c55844a (diff)
downloadFreeBSD-src-d7a91dc6bf166a266421facb5e7cc8067695b03b.zip
FreeBSD-src-d7a91dc6bf166a266421facb5e7cc8067695b03b.tar.gz
Plug reference leaks in the link-layer code ("new-arp") that previously
prevented the link-layer entry from being freed. In both in.c and in6.c (though that code path seems to be basically dead) plug a reference leak in case of a pending callout being drained. In if_ether.c consistently add a reference before resetting the callout and in case we canceled a pending one remove the reference for that. In the final case in arptimer, before freeing the expired entry, remove the reference again and explicitly call callout_stop() to clear the active flag. In nd6.c:nd6_free() we are only ever called from the callout function and thus need to remove the reference there as well before calling into llentry_free(). In if_llatbl.c when freeing entire tables make sure that in case we cancel a pending callout to remove the reference as well. Reviewed by: qingli (earlier version) MFC after: 10 days Problem observed, patch tested by: simon on ipv6gw.f.o, Christian Kratzer (ck cksoft.de), Evgenii Davidov (dado korolev-net.ru) PR: kern/144564 Configurations still affected: with options FLOWTABLE
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_llatbl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index f934af5..c9b41f9 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -170,9 +170,12 @@ lltable_free(struct lltable *llt)
for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
+ int canceled;
- callout_drain(&lle->la_timer);
+ canceled = callout_drain(&lle->la_timer);
LLE_WLOCK(lle);
+ if (canceled)
+ LLE_REMREF(lle);
llentry_free(lle);
}
}
OpenPOWER on IntegriCloud