Add assertions

We must not destroy llentries holding mbufs.
This commit is contained in:
ozaki-r 2018-03-06 07:20:41 +00:00
parent e3a4d36d02
commit bcf876e060
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.219 2018/02/24 07:37:09 ozaki-r Exp $ */
/* $NetBSD: in.c,v 1.220 2018/03/06 07:20:41 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.219 2018/02/24 07:37:09 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.220 2018/03/06 07:20:41 ozaki-r Exp $");
#include "arp.h"
@ -1935,6 +1935,8 @@ static void
in_lltable_destroy_lle(struct llentry *lle)
{
KASSERT(lle->la_numheld == 0);
LLE_WUNLOCK(lle);
LLE_LOCK_DESTROY(lle);
kmem_intr_free(lle, sizeof(*lle));

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.c,v 1.260 2018/02/24 07:37:09 ozaki-r Exp $ */
/* $NetBSD: in6.c,v 1.261 2018/03/06 07:20:41 ozaki-r Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.260 2018/02/24 07:37:09 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.261 2018/03/06 07:20:41 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -2403,6 +2403,8 @@ static void
in6_lltable_destroy_lle(struct llentry *lle)
{
KASSERT(lle->la_numheld == 0);
LLE_WUNLOCK(lle);
LLE_LOCK_DESTROY(lle);
kmem_intr_free(lle, sizeof(struct in6_llentry));