diff options
author | thompsa <thompsa@FreeBSD.org> | 2008-01-18 00:19:10 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2008-01-18 00:19:10 +0000 |
commit | f99e03f7fe903970489c85fbae5965ef79f8d6c5 (patch) | |
tree | 306913d3778a3a972293b072e41109ea2b0e5ad9 /sys/net/if_bridge.c | |
parent | 4d2d2276c89d16d6686c32b709d17b5333f0c812 (diff) | |
download | FreeBSD-src-f99e03f7fe903970489c85fbae5965ef79f8d6c5.zip FreeBSD-src-f99e03f7fe903970489c85fbae5965ef79f8d6c5.tar.gz |
IEEE 802.1D-2004 states, frames containing any of the group MAC Addresses
specified in Table 7-10 in their destination address field shall not be relayed
by the Bridge. Add a check in bridge_forward() to adhere to this.
PR: kern/119744
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r-- | sys/net/if_bridge.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 7d068ff..1604351 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1925,6 +1925,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, struct ifnet *src_if, *dst_if, *ifp; struct ether_header *eh; uint16_t vlan; + uint8_t *dst; int error; src_if = m->m_pkthdr.rcvif; @@ -1939,6 +1940,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, goto drop; eh = mtod(m, struct ether_header *); + dst = eh->ether_dhost; /* If the interface is learning, record the address. */ if (sbif->bif_flags & IFBIF_LEARNING) { @@ -1966,10 +1968,21 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, * "this" side of the bridge, drop it. */ if ((m->m_flags & (M_BCAST|M_MCAST)) == 0) { - dst_if = bridge_rtlookup(sc, eh->ether_dhost, vlan); + dst_if = bridge_rtlookup(sc, dst, vlan); if (src_if == dst_if) goto drop; } else { + /* + * Check if its a reserved multicast address, any address + * listed in 802.1D section 7.12.6 may not be forwarded by the + * bridge. + * This is currently 01-80-C2-00-00-00 to 01-80-C2-00-00-0F + */ + if (dst[0] == 0x01 && dst[1] == 0x80 && + dst[2] == 0xc2 && dst[3] == 0x00 && + dst[4] == 0x00 && dst[5] <= 0x0f) + goto drop; + /* ...forward it to all interfaces. */ ifp->if_imcasts++; dst_if = NULL; |