From ec73437395b3868d6edcaddef987ea0e4a3ad9a8 Mon Sep 17 00:00:00 2001 From: Bosko Milekic Date: Thu, 20 Feb 2003 03:01:04 +0000 Subject: [PATCH] Fix a serious bug when computing the index for the reference counter array for mbuf clusters. I don't know how this got past early testing nor how it survived so long without getting caught. If anyone was seeing really really bizarre memory corruption in a few mbufs this would be why. --- sys/kern/subr_mbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c index 0713b7bf0868..171ccaead71e 100644 --- a/sys/kern/subr_mbuf.c +++ b/sys/kern/subr_mbuf.c @@ -1059,7 +1059,7 @@ mb_reclaim(void) } while (0) #define cl2ref(cl) \ - (((uintptr_t)(cl) - (uintptr_t)cl_refcntmap) >> MCLSHIFT) + (((uintptr_t)(cl) - (uintptr_t)mb_list_clust.ml_mapbase) >> MCLSHIFT) #define _mext_dealloc_ref(m) \ if ((m)->m_ext.ext_type != EXT_EXTREF) \