From: mtaylor Date: Tue, 15 Jan 2008 23:54:34 +0000 (+0000) Subject: When IFF_MULTICAST was not enabled on the vap, we used to skip some filtering that... X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=e7ccdf6be32c9372c2b4569f6d0e7abdf235de79;p=madwifi%2F.git When IFF_MULTICAST was not enabled on the vap, we used to skip some filtering that prevents reception of your own multicast traffic. Then we would procede to ignore the fact that IFF_MULTICAST flag was disabled and send anyway. I've fixed the logic so that multicast is dropped, with an error when disabled. I don't think this is a valid configuration. Also, we don't skip the filtering logic so that our own multicast traffic doesn't come back to us (looking like a bridging loop). git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3132 0192ed92-7a03-0410-a25b-9323aeb14dbd --- diff --git a/net80211/ieee80211_input.c b/net80211/ieee80211_input.c index c8e20ca..6e86580 100644 --- a/net80211/ieee80211_input.c +++ b/net80211/ieee80211_input.c @@ -447,8 +447,19 @@ ieee80211_input(struct ieee80211_node *ni, vap->iv_stats.is_rx_wrongdir++; goto out; } - if ((dev->flags & IFF_MULTICAST) && - IEEE80211_IS_MULTICAST(wh->i_addr1)) { + + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + /* Discard multicast if IFF_MULTICAST not set */ + if ((0 != memcmp(wh->i_addr3, dev->broadcast, ETH_ALEN)) && + (0 == (dev->flags & IFF_MULTICAST))) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "multicast disabled."); + printk(KERN_ERR "CONFIG ERROR: multicast flag " + "cleared on radio, but multicast was used.\n"); + vap->iv_stats.is_rx_mcastdisabled++; + goto out; + } + /* Discard echos of our own multicast or broadcast */ if (IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_myaddr)) { /* * In IEEE802.11 network, multicast packet diff --git a/net80211/ieee80211_ioctl.h b/net80211/ieee80211_ioctl.h index 06ecb52..7465613 100644 --- a/net80211/ieee80211_ioctl.h +++ b/net80211/ieee80211_ioctl.h @@ -105,6 +105,7 @@ struct ieee80211_stats { u_int32_t is_rx_dup; /* rx discard due to it's a dup */ u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */ u_int32_t is_rx_mcastecho; /* rx discard due to of mcast echo */ + u_int32_t is_rx_mcastdisabled; /* rx discard due to of mcast disabled */ u_int32_t is_rx_notassoc; /* rx discard due to sta !assoc */ u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */ u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */