Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add assertions
details: https://anonhg.NetBSD.org/src/rev/4ccaf18ca1e2
branches: trunk
changeset: 321193:4ccaf18ca1e2
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Tue Mar 06 07:20:41 2018 +0000
description:
Add assertions
We must not destroy llentries holding mbufs.
diffstat:
sys/netinet/in.c | 6 ++++--
sys/netinet6/in6.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r 99890131cbb1 -r 4ccaf18ca1e2 sys/netinet/in.c
--- a/sys/netinet/in.c Tue Mar 06 07:19:03 2018 +0000
+++ b/sys/netinet/in.c Tue Mar 06 07:20:41 2018 +0000
@@ -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 @@
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));
diff -r 99890131cbb1 -r 4ccaf18ca1e2 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Tue Mar 06 07:19:03 2018 +0000
+++ b/sys/netinet6/in6.c Tue Mar 06 07:20:41 2018 +0000
@@ -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 @@
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));
Home |
Main Index |
Thread Index |
Old Index