Add KASSERT.

This commit is contained in:
christos 2017-01-11 18:25:46 +00:00
parent edd2c34241
commit 88f657f139
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.c,v 1.231 2017/01/10 05:42:34 ozaki-r Exp $ */ /* $NetBSD: in6.c,v 1.232 2017/01/11 18:25:46 christos Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/* /*
@ -62,7 +62,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.231 2017/01/10 05:42:34 ozaki-r Exp $"); __KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.232 2017/01/11 18:25:46 christos Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -1770,6 +1770,8 @@ in6ifa_ifpforlinklocal(const struct ifnet *ifp, const int ignoreflags)
{ {
struct ifaddr *best_ifa = NULL, *ifa; struct ifaddr *best_ifa = NULL, *ifa;
KASSERT(ifp != NULL);
IFADDR_READER_FOREACH(ifa, ifp) { IFADDR_READER_FOREACH(ifa, ifp) {
if (ifa->ifa_addr->sa_family != AF_INET6) if (ifa->ifa_addr->sa_family != AF_INET6)
continue; continue;