When IFF_MULTICAST was not enabled on the vap, we used to skip some filtering that...
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Tue, 15 Jan 2008 23:54:34 +0000 (23:54 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Tue, 15 Jan 2008 23:54:34 +0000 (23:54 +0000)
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

net80211/ieee80211_input.c
net80211/ieee80211_ioctl.h

index c8e20ca0e11985322f4219707acc7620fdf8147a..6e865802467837df6b6aeb91ec6f0d8f61e4b581 100644 (file)
@@ -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
index 06ecb529191c49076d290b46cc47ff199674d02e..74656139a4f3d19755471a4776b18aeba4118f87 100644 (file)
@@ -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 */