Index: sys/net/if_bridge.c =================================================================== RCS file: /cvsroot/src/sys/net/if_bridge.c,v retrieving revision 1.121 diff -u -p -r1.121 if_bridge.c --- sys/net/if_bridge.c 28 Apr 2016 01:37:17 -0000 1.121 +++ sys/net/if_bridge.c 28 Apr 2016 14:00:31 -0000 @@ -1437,76 +1437,19 @@ bridge_output(struct ifnet *ifp, struct * If the packet is a multicast, or we don't know a better way to * get there, send to all interfaces. */ - if (ETHER_IS_MULTICAST(eh->ether_dhost)) + if (ETHER_IS_MULTICAST(eh->ether_dhost)) { + if (memcmp(etherbroadcastaddr, + eh->ether_dhost, ETHER_ADDR_LEN) == 0) + m->m_flags |= M_BCAST; + else + m->m_flags |= M_MCAST; dst_if = NULL; - else + } else dst_if = bridge_rtlookup(sc, eh->ether_dhost); if (dst_if == NULL) { - struct bridge_iflist *bif; - struct mbuf *mc; - bool used = false; - - BRIDGE_PSZ_RENTER(s); - BRIDGE_IFLIST_READER_FOREACH(bif, sc) { - struct psref psref; - - bridge_acquire_member(sc, bif, &psref); - BRIDGE_PSZ_REXIT(s); - - dst_if = bif->bif_ifp; - if ((dst_if->if_flags & IFF_RUNNING) == 0) - goto next; - - /* - * If this is not the original output interface, - * and the interface is participating in spanning - * tree, make sure the port is in a state that - * allows forwarding. - */ - if (dst_if != ifp && - (bif->bif_flags & IFBIF_STP) != 0) { - switch (bif->bif_state) { - case BSTP_IFSTATE_BLOCKING: - case BSTP_IFSTATE_LISTENING: - case BSTP_IFSTATE_DISABLED: - goto next; - } - } - - if (PSLIST_READER_NEXT(bif, struct bridge_iflist, - bif_next) == NULL) { - used = true; - mc = m; - } else { - mc = m_copym(m, 0, M_COPYALL, M_NOWAIT); - if (mc == NULL) { - sc->sc_if.if_oerrors++; - goto next; - } - } - -#ifndef NET_MPSAFE - s = splnet(); -#endif - bridge_enqueue(sc, dst_if, mc, 0); -#ifndef NET_MPSAFE - splx(s); -#endif -next: - BRIDGE_PSZ_RENTER(s); - bridge_release_member(sc, bif, &psref); - - /* Guarantee we don't re-enter the loop as we already - * decided we're at the end. */ - if (used) - break; - } - BRIDGE_PSZ_REXIT(s); - - if (!used) - m_freem(m); - return (0); - } + bridge_broadcast(sc, ifp, m); + return 0; + } sendunicast: /*