diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -336,6 +336,17 @@ return (0); M_ASSERTPKTHDR(m); + /* + * We could just transmit this, but it makes testing easier if we're a + * little bit more like real hardware. + * Allow just that little bit extra for ethernet (and vlan) headers. + */ + if (m->m_pkthdr.len > (ifp->if_mtu + sizeof(struct ether_vlan_header))) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (E2BIG); + } + /* * We are not going to use the interface en/dequeue mechanism * on the TX side. We are called from ether_output_frame()