Skip to content

Commit

Permalink
do not follow m == NULL when packet is too short and pullup is failed.
Browse files Browse the repository at this point in the history
found in interim meeting network
  • Loading branch information
itojun committed Sep 29, 1999
1 parent b05dc44 commit 64d0efa
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions kame/sys/netinet6/ip6_input.c
Expand Up @@ -326,11 +326,14 @@ ip6_input(m)

IP6_EXTHDR_CHECK(m, 0, sizeof(struct ip6_hdr), /*nothing*/);

if (m->m_len < sizeof(struct ip6_hdr) &&
(m = m_pullup(m, sizeof(struct ip6_hdr))) == 0) {
ip6stat.ip6s_toosmall++;
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr);
return;
if (m->m_len < sizeof(struct ip6_hdr)) {
struct ifnet *inifp;
inifp = m->m_pkthdr.rcvif;
if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == 0) {
ip6stat.ip6s_toosmall++;
in6_ifstat_inc(inifp, ifs6_in_hdrerr);
return;
}
}

ip6 = mtod(m, struct ip6_hdr *);
Expand Down

0 comments on commit 64d0efa

Please sign in to comment.