It makes sense to not retransmit a packet on the interface it was
received from but we should still call bridge_localbroadcast() on
this interface otherwise the network stack never see this packet.

This fix the configuration where you have a vlan(4) on top of an
interface in a bridge(4) and the vlan(4) is not in the bridge(4).

ok?

Index: net/if_bridge.c
===================================================================
RCS file: /cvs/src/sys/net/if_bridge.c,v
retrieving revision 1.244
diff -u -p -r1.244 if_bridge.c
--- net/if_bridge.c     16 Jun 2015 11:09:39 -0000      1.244
+++ net/if_bridge.c     17 Jun 2015 12:05:05 -0000
@@ -1500,12 +1500,9 @@ bridge_broadcast(struct bridge_softc *sc
        int len, used = 0;
 
        TAILQ_FOREACH(p, &sc->sc_iflist, next) {
-               /*
-                * Don't retransmit out of the same interface where
-                * the packet was received from.
-                */
                dst_if = p->ifp;
-               if (dst_if->if_index == ifp->if_index)
+
+               if ((dst_if->if_flags & IFF_RUNNING) == 0)
                        continue;
 
                if ((p->bif_flags & IFBIF_STP) &&
@@ -1516,15 +1513,6 @@ bridge_broadcast(struct bridge_softc *sc
                    (m->m_flags & (M_BCAST | M_MCAST)) == 0)
                        continue;
 
-               if ((dst_if->if_flags & IFF_RUNNING) == 0)
-                       continue;
-
-               if (IF_QFULL(&dst_if->if_snd)) {
-                       IF_DROP(&dst_if->if_snd);
-                       sc->sc_if.if_oerrors++;
-                       continue;
-               }
-
                /* Drop non-IP frames if the appropriate flag is set. */
                if (p->bif_flags & IFBIF_BLOCKNONIP &&
                    bridge_blocknonip(eh, m))
@@ -1534,6 +1522,19 @@ bridge_broadcast(struct bridge_softc *sc
                        continue;
 
                bridge_localbroadcast(sc, dst_if, eh, m);
+
+               /*
+                * Don't retransmit out of the same interface where
+                * the packet was received from.
+                */
+               if (dst_if->if_index == ifp->if_index)
+                       continue;
+
+               if (IF_QFULL(&dst_if->if_snd)) {
+                       IF_DROP(&dst_if->if_snd);
+                       sc->sc_if.if_oerrors++;
+                       continue;
+               }
 
                /* If last one, reuse the passed-in mbuf */
                if (TAILQ_NEXT(p, next) == NULL) {

Reply via email to