diff options
author | bms <bms@FreeBSD.org> | 2004-06-18 12:58:45 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2004-06-18 12:58:45 +0000 |
commit | 66acd3ba6eb9d3017cc3cdf36d1268749512dd82 (patch) | |
tree | f1d6be892336657e5e0db38f23381e746abbe9d1 /sys/netinet/ip_input.c | |
parent | d11f8ce42b5a43a462a0b6787677fb5b19014f17 (diff) | |
download | FreeBSD-src-66acd3ba6eb9d3017cc3cdf36d1268749512dd82.zip FreeBSD-src-66acd3ba6eb9d3017cc3cdf36d1268749512dd82.tar.gz |
Check that m->m_pkthdr.rcvif is not NULL before checking if a packet
was received on a broadcast address on the input path. Under certain
circumstances this could result in a panic, notably for locally-generated
packets which do not have m_pkthdr.rcvif set.
This is a similar situation to that which is solved by
src/sys/netinet/ip_icmp.c rev 1.66.
PR: kern/52935
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index a84ed07..048f613 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -587,7 +587,8 @@ pass: * be handled via ip_forward() and ether_output() with the loopback * into the stack for SIMPLEX interfaces handled by ether_output(). */ - if (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST) { + if (m->m_pkthdr.rcvif != NULL && + m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST) { TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET) continue; |