Pull up to ETHER_HDR_LEN before passing an mbuf to ether_input().

The bug was found by running ng_dummy(4) node configured with a
delay, in front of the ng_eiface(4) node.
This commit is contained in:
Ruslan Ermilov 2005-03-01 19:39:57 +00:00
parent b86d93e940
commit a9a03de54d
1 changed files with 6 additions and 0 deletions

View File

@ -613,6 +613,12 @@ ng_eiface_rcvdata(hook_p hook, item_p item)
return (ENETDOWN);
}
if (m->m_len < ETHER_HDR_LEN) {
m = m_pullup(m, ETHER_HDR_LEN);
if (m == NULL)
return (EINVAL);
}
/* Note receiving interface */
m->m_pkthdr.rcvif = ifp;