From bb4b5f54a52ba99a4c4acd2dd3cd5786cd63f50e Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Sun, 13 Nov 2005 19:36:59 +0000 Subject: [PATCH] Fix a mbuf and refcnt leak in the broadcast code. If the packet is rejected from pfil(9) then continue the loop rather than returning, this means that we can still try to send it out the remaining interfaces but more importantly the mbuf is freed and refcount decremented on exit. --- sys/net/if_bridge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 89f7420c4c0..e3d5ef66795 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1871,10 +1871,10 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, || inet6_pfil_hook.ph_busy_count >= 0 #endif )) { - if (bridge_pfil(&m, NULL, dst_if, PFIL_OUT) != 0) - return; - if (m == NULL) - return; + if (bridge_pfil(&mc, NULL, dst_if, PFIL_OUT) != 0) + continue; + if (mc == NULL) + continue; } bridge_enqueue(sc, dst_if, mc);