From ebf1c74403365a05f29bb0582b1c3496f6eb59de Mon Sep 17 00:00:00 2001 From: Qing Li Date: Mon, 22 Dec 2008 07:11:15 +0000 Subject: [PATCH] Similar to the INET case, do not destroy the nd6 entries for interface addresses until those addresses are removed. I already made the patch in INET but forgot to bring the code over for INET6. --- sys/netinet6/in6.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 6ba852c4536d..ee061994920e 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2204,12 +2204,14 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, lle->lle_head = lleh; LIST_INSERT_HEAD(lleh, lle, lle_next); } else if (flags & LLE_DELETE) { - LLE_WLOCK(lle); - lle->la_flags = LLE_DELETED; - LLE_WUNLOCK(lle); + if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { + LLE_WLOCK(lle); + lle->la_flags = LLE_DELETED; + LLE_WUNLOCK(lle); #ifdef DIAGNOSTICS - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif + } lle = (void *)-1; } if (LLE_IS_VALID(lle)) {