Module Name: src Committed By: ozaki-r Date: Tue Jun 30 08:31:42 UTC 2015
Modified Files: src/sys/netinet6: nd6.c Log Message: Use KASSERT for argument NULL checks To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 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.162 src/sys/netinet6/nd6.c:1.163 --- src/sys/netinet6/nd6.c:1.162 Thu Apr 30 10:00:04 2015 +++ src/sys/netinet6/nd6.c Tue Jun 30 08:31:42 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: nd6.c,v 1.162 2015/04/30 10:00:04 ozaki-r Exp $ */ +/* $NetBSD: nd6.c,v 1.163 2015/06/30 08:31:42 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.162 2015/04/30 10:00:04 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.163 2015/06/30 08:31:42 ozaki-r Exp $"); #include "opt_net_mpsafe.h" @@ -279,10 +279,9 @@ nd6_option(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int olen; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_option"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_option"); + KASSERT(ndopts != NULL); + KASSERT(ndopts->nd_opts_last != NULL); + if (ndopts->nd_opts_search == NULL) return NULL; if (ndopts->nd_opts_done) @@ -330,10 +329,9 @@ nd6_options(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int i = 0; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_options"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_options"); + KASSERT(ndopts != NULL); + KASSERT(ndopts->nd_opts_last != NULL); + if (ndopts->nd_opts_search == NULL) return 0; @@ -1898,10 +1896,8 @@ nd6_cache_lladdr( int llchange; int newstate = 0; - if (ifp == NULL) - panic("ifp == NULL in nd6_cache_lladdr"); - if (from == NULL) - panic("from == NULL in nd6_cache_lladdr"); + KASSERT(ifp != NULL); + KASSERT(from != NULL); /* nothing must be updated for unspecified address */ if (IN6_IS_ADDR_UNSPECIFIED(from))