diff --git a/sys/net/if_ieee1394.h b/sys/net/if_ieee1394.h index 4e86c18..df9eb73 100644 --- a/sys/net/if_ieee1394.h +++ b/sys/net/if_ieee1394.h @@ -105,6 +105,7 @@ struct ieee1394com { struct ieee1394_hwaddr ic_hwaddr; uint16_t ic_dgl; LIST_HEAD(, ieee1394_reassq) ic_reassq; + bool ic_drainwanted; }; const char *ieee1394_sprintf(const uint8_t *); diff --git a/sys/net/if_ieee1394subr.c b/sys/net/if_ieee1394subr.c index cea0249..1e795d9 100644 --- a/sys/net/if_ieee1394subr.c +++ b/sys/net/if_ieee1394subr.c @@ -617,6 +617,14 @@ ieee1394_reass(struct ifnet *ifp, struct mbuf *m0, uint16_t src) return NULL; } +static void +ieee1394_drainstub(struct ifnet *ifp) +{ + struct ieee1394com *ic = (struct ieee1394com *)ifp; + + ic->ic_drainwanted = true; +} + void ieee1394_drain(struct ifnet *ifp) { @@ -657,6 +665,11 @@ ieee1394_watchdog(struct ifnet *ifp) } } } + + if (ic->ic_drainwanted) { + ieee1394_drain(ifp); + ic->ic_drainwanted = false; + } } const char * @@ -681,7 +694,7 @@ ieee1394_ifattach(struct ifnet *ifp, const struct ieee1394_hwaddr *hwaddr) ifp->if_dlt = DLT_EN10MB; /* XXX */ ifp->if_mtu = IEEE1394MTU; ifp->if_output = ieee1394_output; - ifp->if_drain = ieee1394_drain; + ifp->if_drain = ieee1394_drainstub; ifp->if_watchdog = ieee1394_watchdog; ifp->if_timer = 1; if (ifp->if_baudrate == 0) @@ -696,6 +709,7 @@ ieee1394_ifattach(struct ifnet *ifp, const struct ieee1394_hwaddr *hwaddr) memset(baddr->iha_offset, 0, sizeof(baddr->iha_offset)); ifp->if_broadcastaddr = (uint8_t *)baddr; LIST_INIT(&ic->ic_reassq); + ic->ic_drainwanted = false; bpf_attach(ifp, DLT_APPLE_IP_OVER_IEEE1394, sizeof(struct ieee1394_hwaddr)); }