-/* $OpenBSD: if_bridge.c,v 1.267 2015/10/05 19:05:09 uebayasi Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.268 2015/10/12 10:03:25 reyk Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
struct mbuf *bridge_ip(struct bridge_softc *, int, struct ifnet *,
struct ether_header *, struct mbuf *m);
int bridge_ifenqueue(struct bridge_softc *, struct ifnet *, struct mbuf *);
+void bridge_ifinput(struct ifnet *, struct mbuf *);
void bridge_fragment(struct bridge_softc *, struct ifnet *,
struct ether_header *, struct mbuf *);
void bridge_send_icmp_err(struct bridge_softc *, struct ifnet *,
struct bridge_iflist *srcifl;
struct ether_header *eh;
struct arpcom *ac;
- struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *mc;
ifl = (struct bridge_iflist *)ifp->if_bridgeport;
if (mc == NULL)
goto reenqueue;
- mc->m_flags |= M_PROTO1;
- ml_enqueue(&ml, mc);
- if_input(ifp, &ml);
+ bridge_ifinput(ifp, mc);
#if NGIF > 0
if (ifp->if_type == IFT_GIF) {
TAILQ_FOREACH(ifl, &sc->sc_iflist, next) {
if (ifl->ifp->if_type != IFT_ETHER)
continue;
- m->m_flags |= M_PROTO1;
- ml_enqueue(&ml, m);
- if_input(ifl->ifp, &ml);
+ bridge_ifinput(ifl->ifp, m);
return;
}
}
sc->sc_if.if_ipackets++;
sc->sc_if.if_ibytes += m->m_pkthdr.len;
- m->m_flags |= M_PROTO1;
- ml_enqueue(&ml, m);
- if_input(ifl->ifp, &ml);
+ bridge_ifinput(ifl->ifp, m);
return;
}
if (bcmp(ac->ac_enaddr, eh->ether_shost, ETHER_ADDR_LEN) == 0
return;
reenqueue:
- m->m_flags |= M_PROTO1;
- ml_enqueue(&ml, m);
- if_input(ifp, &ml);
+ bridge_ifinput(ifp, m);
}
/*
bridge_localbroadcast(struct bridge_softc *sc, struct ifnet *ifp,
struct ether_header *eh, struct mbuf *m)
{
- struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m1;
u_int16_t etype;
sc->sc_if.if_oerrors++;
return;
}
- m1->m_flags |= M_PROTO1;
- ml_enqueue(&ml, m1);
- if_input(ifp, &ml);
+
+ bridge_ifinput(ifp, m1);
}
void
return (0);
}
+void
+bridge_ifinput(struct ifnet *ifp, struct mbuf *m)
+{
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
+
+ m->m_flags |= M_PROTO1;
+
+ ml_enqueue(&ml, m);
+ if_input(ifp, &ml);
+}
+
void
bridge_send_icmp_err(struct bridge_softc *sc, struct ifnet *ifp,
struct ether_header *eh, struct mbuf *n, int hassnap, struct llc *llc,