summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_eiface.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-03-01 19:39:57 +0000
committerru <ru@FreeBSD.org>2005-03-01 19:39:57 +0000
commitf97d0ba60033ee02b81744f48a2ef2ed51a848e1 (patch)
tree6393959c4439576605ccff6d0cb28a4e934c58c4 /sys/netgraph/ng_eiface.c
parent573b285103a72f64993b43439b9e1b3f3c0e66c0 (diff)
downloadFreeBSD-src-f97d0ba60033ee02b81744f48a2ef2ed51a848e1.zip
FreeBSD-src-f97d0ba60033ee02b81744f48a2ef2ed51a848e1.tar.gz
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.
Diffstat (limited to 'sys/netgraph/ng_eiface.c')
-rw-r--r--sys/netgraph/ng_eiface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index 30e5d94..947d954 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;
OpenPOWER on IntegriCloud