diff options
author | Peter Galbavy <peter@cvs.openbsd.org> | 2000-08-02 08:40:55 +0000 |
---|---|---|
committer | Peter Galbavy <peter@cvs.openbsd.org> | 2000-08-02 08:40:55 +0000 |
commit | c35fb86975237c17add2fc8249d66eb101d8540e (patch) | |
tree | 1e1bd121a2e254c7c04afc5ffd612fb8ce2e19ce /sys/dev | |
parent | 746d8c128d4c08468f4fdf76b6ecf8e04f521e00 (diff) |
Add support for accepting packets up to 4 octets larger than the
interface MTU IFF vlans are enabled.
Additional logic should be added by someone who understand 802.1q to
test if this oversize packet is actually a 802.1q encapsulated, and
reject others.
Fix as per kernel/1328.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/dc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 2c51a4f1c9c..073b4f61d0e 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.5 2000/07/21 15:52:10 mickey Exp $ */ +/* $OpenBSD: dc.c,v 1.6 2000/08/02 08:40:54 peter Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -109,6 +109,7 @@ */ #include "bpfilter.h" +#include "vlan.h" #include <sys/param.h> #include <sys/systm.h> @@ -1715,7 +1716,17 @@ void dc_rxeof(sc) * it should simply get re-used next time this descriptor * comes up in the ring. */ - if (rxstat & DC_RXSTAT_RXERR) { + if (rxstat & DC_RXSTAT_RXERR +#if NVLAN > 0 + /* + * If VLANs are enabled, allow frames up to 4 bytes + * longer than the MTU. This should really check if + * the giant packet has a vlan tag + */ + && ((rxstat & (DC_RXSTAT_GIANT|DC_RXSTAT_LASTFRAG)) == 0 + && total_len <= ifp->if_mtu + 4) +#endif + ) { ifp->if_ierrors++; if (rxstat & DC_RXSTAT_COLLSEEN) ifp->if_collisions++; |