summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-24 18:33:44 +0000
committerglebius <glebius@FreeBSD.org>2012-10-24 18:33:44 +0000
commit278c83657aa54ebb2f925731cce0f55827c15ecf (patch)
treea9f7f22604b9f05757f4b5a1706b6a783b9a97a8
parentddaaa16d8bf9166c047fc5d46f14c1877a1bcaf7 (diff)
downloadFreeBSD-src-278c83657aa54ebb2f925731cce0f55827c15ecf.zip
FreeBSD-src-278c83657aa54ebb2f925731cce0f55827c15ecf.tar.gz
Fix fallout from r240071. If destination interface lookup fails,
we should broadcast a packet, not try to deliver it to NULL. Reported by: rpaulo
-rw-r--r--sys/net/if_bridge.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index e4ce154..11cd3d6 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1988,20 +1988,19 @@ static int
bridge_transmit(struct ifnet *ifp, struct mbuf *m)
{
struct bridge_softc *sc;
+ struct ether_header *eh;
+ struct ifnet *dst_if;
int error = 0;
sc = ifp->if_softc;
ETHER_BPF_MTAP(ifp, m);
+ eh = mtod(m, struct ether_header *);
BRIDGE_LOCK(sc);
- if ((m->m_flags & (M_BCAST|M_MCAST)) == 0) {
- struct ether_header *eh;
- struct ifnet *dst_if;
-
- eh = mtod(m, struct ether_header *);
- dst_if = bridge_rtlookup(sc, eh->ether_dhost, 1);
+ if (((m->m_flags & (M_BCAST|M_MCAST)) == 0) &&
+ (dst_if = bridge_rtlookup(sc, eh->ether_dhost, 1)) != NULL) {
BRIDGE_UNLOCK(sc);
error = bridge_enqueue(sc, dst_if, m);
} else
OpenPOWER on IntegriCloud