Module Name:    src
Committed By:   ozaki-r
Date:           Wed Sep  2 08:03:10 UTC 2015

Modified Files:
        src/sys/netinet6: nd6.c

Log Message:
Use KASSERT to check programming errors


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/netinet6/nd6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.172 src/sys/netinet6/nd6.c:1.173
--- src/sys/netinet6/nd6.c:1.172	Tue Sep  1 08:52:02 2015
+++ src/sys/netinet6/nd6.c	Wed Sep  2 08:03:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.172 2015/09/01 08:52:02 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.173 2015/09/02 08:03:10 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.172 2015/09/01 08:52:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.173 2015/09/02 08:03:10 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -451,10 +451,11 @@ nd6_llinfo_timer(void *arg)
 		return;
 	}
 
-	if ((rt = ln->ln_rt) == NULL)
-		panic("ln->ln_rt == NULL");
-	if ((ifp = rt->rt_ifp) == NULL)
-		panic("ln->ln_rt->rt_ifp == NULL");
+	rt = ln->ln_rt;
+	KASSERT(rt != NULL);
+	ifp = rt->rt_ifp;
+	KASSERT(ifp != NULL);
+
 	ndi = ND_IFINFO(ifp);
 	dst = satocsin6(rt_getkey(rt));
 

Reply via email to