summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-05-09 05:37:37 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-05-09 05:37:37 +0000
commite9ee019b2912773cd90d4588200934df0c616033 (patch)
tree8d1037fb76ff7bb04052390d5610a813f361f17d
parentf8c9d79e08f056fe56cc942842c406318c0871bc (diff)
Make sure that prefixes get purged.
Fixes PR 3939. From NetBSD ok itojun@
-rw-r--r--sys/netinet6/nd6.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index e29ff4b259f..cddb5e29871 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.68 2004/10/28 20:34:57 henning Exp $ */
+/* $OpenBSD: nd6.c,v 1.69 2005/05/09 05:37:36 brad Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -623,6 +623,13 @@ nd6_purge(ifp)
npr = pr->ndpr_next;
if (pr->ndpr_ifp == ifp) {
/*
+ * Because if_detach() does *not* release prefixes
+ * while purging addresses the reference count will
+ * still be above zero. We therefore reset it to
+ * make sure that the prefix really gets purged.
+ */
+ pr->ndpr_refcnt = 0;
+ /*
* Previously, pr->ndpr_addr is removed as well,
* but I strongly believe we don't have to do it.
* nd6_purge() is only called from in6_ifdetach(),