diff options
author | ru <ru@FreeBSD.org> | 2005-02-18 22:31:19 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-02-18 22:31:19 +0000 |
commit | 79c91b9063b488741efc68e2badefc608f4fb4d4 (patch) | |
tree | d7beeb22153c2c6c50bd61f34eaab74d6bc20b1b /sys/net/if_ethersubr.c | |
parent | f35103b728ad51548ba5fbf5f098634a370e7635 (diff) | |
download | FreeBSD-src-79c91b9063b488741efc68e2badefc608f4fb4d4.zip FreeBSD-src-79c91b9063b488741efc68e2badefc608f4fb4d4.tar.gz |
Allocate the M_VLANTAG m_pkthdr flag, and use it to indicate that
a packet has VLAN mbuf tag attached. This is faster to check than
m_tag_locate(), and allows us to use the tags in non-vlan(4) VLAN
producers.
The first argument to VLAN_OUTPUT_TAG() is now unused but retained
for backward compatibility.
While here, embellish a fix in rev. 1.174 of if_ethersubr.c -- it
now checks for packets with VLAN (mbuf) tags, and it should now
be possible to bridge(4) on vlan(4)'s whose parent interfaces
support VLAN decapsulation in hardware.
Reviewed by: sam
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index eb9fed0..1b973fe 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -604,7 +604,8 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) #endif if (!(BDG_ACTIVE(ifp)) && - !(ether_type == ETHERTYPE_VLAN && ifp->if_nvlans > 0)) { + !((ether_type == ETHERTYPE_VLAN || m->m_flags & M_VLANTAG) && + ifp->if_nvlans > 0)) { /* * Discard packet if upper layers shouldn't see it because it * was unicast to a different Ethernet address. If the driver @@ -618,7 +619,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) * it's undesired. */ if ((ifp->if_flags & IFF_PROMISC) != 0 - && (eh->ether_dhost[0] & 1) == 0 + && !ETHER_IS_MULTICAST(eh->ether_dhost) && bcmp(eh->ether_dhost, IFP2AC(ifp)->ac_enaddr, ETHER_ADDR_LEN) != 0 && (ifp->if_flags & IFF_PPROMISC) == 0) { @@ -657,8 +658,7 @@ post_stats: * Check to see if the device performed the VLAN decapsulation and * provided us with the tag. */ - if (m_tag_first(m) != NULL && - m_tag_locate(m, MTAG_VLAN, MTAG_VLAN_TAG, NULL) != NULL) { + if (m->m_flags & M_VLANTAG) { /* * If no VLANs are configured, drop. */ |