diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-03-11 16:06:26 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-03-11 16:06:26 +0000 |
commit | 64f827090085ae77934662a0b8b0e813a28ed877 (patch) | |
tree | 43c0bb90185c534058156dca268526a6423d9de5 /sys/net | |
parent | 67a920ad742b4f4b71351a51b5a0911be42fff27 (diff) |
forward 8021Q packets with vlan header if the destination interface has
IFCAP_VLAN_MTU capability. allows forwarding of vlan traffic over
bridge(4) since these packets are larger then the mtu; ok jason@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_bridge.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 388315faff9..df9b5011d4e 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.112 2003/02/21 21:49:37 jason Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.113 2003/03/11 16:06:25 markus Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -39,6 +39,7 @@ #include "bpfilter.h" #include "gif.h" #include "pf.h" +#include "vlan.h" #include <sys/param.h> #include <sys/proc.h> @@ -90,6 +91,10 @@ #include <net/bpf.h> #endif +#if NVLAN > 0 +#include <net/if_vlan_var.h> +#endif + #include <net/if_bridge.h> #ifndef BRIDGE_RTABLE_SIZE @@ -2517,6 +2522,17 @@ bridge_fragment(sc, ifp, eh, m) goto dropit; #else etype = ntohs(eh->ether_type); +#if NVLAN > 0 + if (etype == ETHERTYPE_8021Q && + (ifp->if_capabilities & IFCAP_VLAN_MTU) && + ((m->m_pkthdr.len - sizeof(struct ether_vlan_header)) <= + ifp->if_mtu)) { + s = splimp(); + bridge_ifenqueue(sc, ifp, m); + splx(s); + return; + } +#endif if (etype != ETHERTYPE_IP) { if (etype > ETHERMTU || m->m_pkthdr.len < (LLC_SNAPFRAMELEN + |