When a bridge is not in RUNNING state packets are simply enqueued on the
interface. But since the introduction of bridge_ifenqueue() they are
accounted as being sent through the bridge. Diff below fixes that by
calling if_enqueue() directly.
ok?
Index: net/if_bridge.c
===================================================================
RCS file: /cvs/src/sys/net/if_bridge.c,v
retrieving revision 1.325
diff -u -p -r1.325 if_bridge.c
--- net/if_bridge.c 12 Mar 2019 11:45:00 -0000 1.325
+++ net/if_bridge.c 29 Mar 2019 13:27:59 -0000
@@ -737,8 +737,10 @@ bridge_output(struct ifnet *ifp, struct
*/
sc = bif->bridge_sc;
if ((sc->sc_if.if_flags & IFF_RUNNING) == 0) {
- dst_if = ifp;
- goto sendunicast;
+ /* Loop prevention. */
+ m->m_flags |= M_PROTO1;
+ error = if_enqueue(ifp, m);
+ return (error);
}
#if NBPFILTER > 0
@@ -810,7 +812,6 @@ bridge_output(struct ifnet *ifp, struct
return (0);
}
-sendunicast:
if ((dst_if->if_flags & IFF_RUNNING) == 0) {
m_freem(m);
return (ENETDOWN);