summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2005-10-02 19:15:56 +0000
committerthompsa <thompsa@FreeBSD.org>2005-10-02 19:15:56 +0000
commitc9aa4c7309829b3a171fef8312658e6f688ab0d7 (patch)
tree141ea952cf78b753e3084f13e10c46c72748c7fc
parent778f700a6719138837df97cf5abfa2f4c8c80e9b (diff)
downloadFreeBSD-src-c9aa4c7309829b3a171fef8312658e6f688ab0d7.zip
FreeBSD-src-c9aa4c7309829b3a171fef8312658e6f688ab0d7.tar.gz
Do not packet filter in the bridge_start() routine, locally generated packets
are already filtered by the higher layers. Approved by: mlaier (mentor) MFC after: 3 days
-rw-r--r--sys/net/if_bridge.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index d112474..348c5fc 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -194,7 +194,8 @@ void bridge_forward(struct bridge_softc *, struct mbuf *m);
void bridge_timer(void *);
-void bridge_broadcast(struct bridge_softc *, struct ifnet *, struct mbuf *);
+void bridge_broadcast(struct bridge_softc *, struct ifnet *, struct mbuf *,
+ int);
int bridge_rtupdate(struct bridge_softc *, const uint8_t *,
struct ifnet *, int, uint8_t);
@@ -1476,21 +1477,9 @@ bridge_start(struct ifnet *ifp)
}
if (dst_if == NULL)
- bridge_broadcast(sc, ifp, m);
+ bridge_broadcast(sc, ifp, m, 0);
else {
BRIDGE_UNLOCK(sc);
-
- if (inet_pfil_hook.ph_busy_count >= 0
-#ifdef INET6
- || inet6_pfil_hook.ph_busy_count >= 0
-#endif
- ) {
- if (bridge_pfil(&m, sc->sc_ifp, dst_if, PFIL_OUT) != 0)
- return;
- if (m == NULL)
- return;
- }
-
bridge_enqueue(sc, dst_if, m);
}
}
@@ -1608,7 +1597,7 @@ bridge_forward(struct bridge_softc *sc, struct mbuf *m)
/* tap off packets passing the bridge */
BPF_MTAP(ifp, m);
- bridge_broadcast(sc, src_if, m);
+ bridge_broadcast(sc, src_if, m, 1);
return;
}
@@ -1812,7 +1801,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
*/
void
bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
- struct mbuf *m)
+ struct mbuf *m, int runfilt)
{
struct bridge_iflist *bif;
struct mbuf *mc;
@@ -1827,11 +1816,11 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
}
/* Filter on the bridge interface before broadcasting */
- if (inet_pfil_hook.ph_busy_count >= 0
+ if (runfilt && (inet_pfil_hook.ph_busy_count >= 0
#ifdef INET6
|| inet6_pfil_hook.ph_busy_count >= 0
#endif
- ) {
+ )) {
if (bridge_pfil(&m, sc->sc_ifp, NULL, PFIL_OUT) != 0)
return;
if (m == NULL)
@@ -1874,11 +1863,11 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
* pointer so we do not redundantly filter on the bridge for
* each interface we broadcast on.
*/
- if (inet_pfil_hook.ph_busy_count >= 0
+ if (runfilt && (inet_pfil_hook.ph_busy_count >= 0
#ifdef INET6
|| inet6_pfil_hook.ph_busy_count >= 0
#endif
- ) {
+ )) {
if (bridge_pfil(&m, NULL, dst_if, PFIL_OUT) != 0)
return;
if (m == NULL)
OpenPOWER on IntegriCloud