diff options
| author | Matthew N. Dodd <mdodd@FreeBSD.org> | 2003-03-15 21:42:19 +0000 |
|---|---|---|
| committer | Matthew N. Dodd <mdodd@FreeBSD.org> | 2003-03-15 21:42:19 +0000 |
| commit | f156dd7b68addbbfeadbf05ebe3909cc44ad28d4 (patch) | |
| tree | 007cd12a3df2992b8c5a5954098d62797665f86b | |
| parent | 9a3c9f397133e802dce4ffc0a8bd71ee93e05050 (diff) | |
Notes
| -rw-r--r-- | sys/net/if_iso88025subr.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 457a5ab73812..249391c80766 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -412,17 +412,32 @@ iso88025_input(ifp, th, m) int isr; struct llc *l; - if ((ifp->if_flags & IFF_UP) == 0) { - m_freem(m); - return; - } + /* + * Discard packet if interface is not up. + */ + if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + goto dropanyway; #ifdef MAC mac_create_mbuf_from_ifnet(ifp, m); #endif - getmicrotime(&ifp->if_lastchange); + /* + * Update interface statistics. + */ 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. |
