be careful touching m_pkthdr.rcvif, it could be NULL if the packet was

generated from local node and icmp_error calls icmp_reflect.
This commit is contained in:
itojun 2004-06-25 15:24:41 +00:00
parent 3afa4e2a37
commit 59302fc979
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_icmp.c,v 1.84 2004/05/25 04:33:59 atatat Exp $ */
/* $NetBSD: ip_icmp.c,v 1.85 2004/06/25 15:24:41 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.84 2004/05/25 04:33:59 atatat Exp $");
__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.85 2004/06/25 15:24:41 itojun Exp $");
#include "opt_ipsec.h"
@ -665,7 +665,8 @@ icmp_reflect(m)
INADDR_TO_IA(t, ia);
/* look for packet sent to broadcast address */
if (ia == NULL && (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST)) {
if (ia == NULL && m->m_pkthdr.rcvif &&
(m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST)) {
TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;