summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-11-04 05:16:33 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-11-04 05:16:33 +0000
commita7b343da2611bef79312c10ff972c3a395952cd6 (patch)
tree337763dcf26a12c52ca618ecafb12ea769a120fc
parent805be5fa5346a8e2f497be4c89c77b1699f1e67d (diff)
Do a little preprocessing on the incoming mbuf: set the MCAST/BCAST m_flag
as appropriate
-rw-r--r--sys/netinet/ip_ether.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index 8468eb81490..8167733e054 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.2 1999/10/29 02:00:23 angelos Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.3 1999/11/04 05:16:32 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
@@ -164,6 +164,18 @@ va_dcl
if (m->m_flags & (M_CONF|M_AUTH))
m->m_pkthdr.tdbi = NULL;
+ m->m_flags &= ~(M_BCAST|M_MCAST);
+ if (eh.ether_dhost[0] & 1)
+ {
+ if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh.ether_dhost,
+ sizeof(etherbroadcastaddr)) == 0)
+ m->m_flags |= M_BCAST;
+ else
+ m->m_flags |= M_BCAST;
+ }
+ if (m->m_flags & (M_BCAST|M_MCAST))
+ m->m_pkthdr.rcvif->if_imcasts++;
+
#if NBRIDGE > 0
/*
* Tap the packet off here for a bridge, if configured and
@@ -171,7 +183,6 @@ va_dcl
* NULL if it has consumed the packet, otherwise, it
* gets processed as normal.
*/
-
if (m->m_pkthdr.rcvif->if_bridge)
{
m = bridge_input(m->m_pkthdr.rcvif, &eh, m);