diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index 52d8f61..bc5fa9cb 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -71,6 +71,9 @@ struct ether_addr { } __packed; #define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ +#define ETHER_IS_BROADCAST(addr) \ + (((addr)[0] & (addr)[1] & (addr)[2] & \ + (addr)[3] & (addr)[4] & (addr)[5]) == 0xff) /* * 802.1q Virtual LAN header. diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 82c8b3a..dd3e8bd 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -115,8 +115,6 @@ static void ether_reassign(struct ifnet *, struct vnet *, char *); #endif static int ether_requestencap(struct ifnet *, struct if_encap_req *); -#define ETHER_IS_BROADCAST(addr) \ - (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0) #define senderr(e) do { error = (e); goto bad;} while (0) diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index cfa4650..051934e 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -166,14 +166,6 @@ SYSCTL_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); -/* copy from src/sys/net/if_ethersubr.c */ -static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#ifndef ETHER_IS_BROADCAST -#define ETHER_IS_BROADCAST(addr) \ - (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0) -#endif - static int gif_clone_create(struct if_clone *ifc, int unit, caddr_t params) { diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index e367ba2..2a6f2b4 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -283,7 +283,10 @@ ieee80211_deliver_data(struct ieee80211vap *vap, IEEE80211_NODE_STAT(ni, rx_data); IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len); if (ETHER_IS_MULTICAST(eh->ether_dhost)) { - m->m_flags |= M_MCAST; /* XXX M_BCAST? */ + if (ETHER_IS_BROADCAST(eh->ether_dhost)) + m->m_flags |= M_BCAST; + else + m->m_flags |= M_MCAST; IEEE80211_NODE_STAT(ni, rx_mcast); } else IEEE80211_NODE_STAT(ni, rx_ucast);