Date: Wed, 24 Oct 2012 18:33:44 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242013 - head/sys/net Message-ID: <201210241833.q9OIXi77072545@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed Oct 24 18:33:44 2012 New Revision: 242013 URL: http://svn.freebsd.org/changeset/base/242013 Log: Fix fallout from r240071. If destination interface lookup fails, we should broadcast a packet, not try to deliver it to NULL. Reported by: rpaulo Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed Oct 24 18:32:37 2012 (r242012) +++ head/sys/net/if_bridge.c Wed Oct 24 18:33:44 2012 (r242013) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210241833.q9OIXi77072545>