From a9a03de54db9cf696bd9b3fe52aa76810f39f7ae Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 1 Mar 2005 19:39:57 +0000 Subject: [PATCH] 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. --- sys/netgraph/ng_eiface.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 30e5d945afb..947d954cc0e 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -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;