- Adopt tests for (IFF_UP|IFF_RUNNING) and non local unicast packets

in promiscuous mode from if_fddisubr.c.
- Add comment to reduce diffs.
This commit is contained in:
mdodd 2003-03-15 21:42:19 +00:00
parent b9f3e4fdb7
commit b4d176598f

View File

@ -412,17 +412,32 @@ iso88025_input(ifp, th, m)
int isr; int isr;
struct llc *l; struct llc *l;
if ((ifp->if_flags & IFF_UP) == 0) { /*
m_freem(m); * Discard packet if interface is not up.
return; */
} if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
goto dropanyway;
#ifdef MAC #ifdef MAC
mac_create_mbuf_from_ifnet(ifp, m); mac_create_mbuf_from_ifnet(ifp, m);
#endif #endif
getmicrotime(&ifp->if_lastchange); /*
* Update interface statistics.
*/
ifp->if_ibytes += m->m_pkthdr.len + sizeof(*th); ifp->if_ibytes += m->m_pkthdr.len + sizeof(*th);
getmicrotime(&ifp->if_lastchange);
/*
* Discard non local unicast packets when interface
* is in promiscuous mode.
*/
if ((ifp->if_flags & IFF_PROMISC) &&
((th->iso88025_dhost[0] & 1) == 0) &&
(bcmp(IFP2AC(ifp)->ac_enaddr, (caddr_t) th->iso88025_dhost,
ISO88025_ADDR_LEN) != 0))
goto dropanyway;
}
/* /*
* Set mbuf flags for bcast/mcast. * Set mbuf flags for bcast/mcast.