madwifi: fix a wds related race condition
authorFelix Fietkau <nbd@openwrt.org>
Mon, 14 Sep 2009 10:45:34 +0000 (10:45 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 14 Sep 2009 10:45:34 +0000 (10:45 +0000)
SVN-Revision: 17578

12 files changed:
package/madwifi/patches/370-wdsvap.patch
package/madwifi/patches/372-queue_vif.patch
package/madwifi/patches/378-adhoc_crash_fix.patch
package/madwifi/patches/387-maxassoc.patch
package/madwifi/patches/390-frame_type.patch
package/madwifi/patches/391-vap_auth.patch
package/madwifi/patches/393-mbss_vap_auth.patch
package/madwifi/patches/394-probereq.patch
package/madwifi/patches/396-napi_ff_fix.patch
package/madwifi/patches/411-autochannel_multi.patch
package/madwifi/patches/432-netdev_ops.patch
package/madwifi/patches/441-fix_ibss_node_handling.patch

index 488e7b2444f282e4de2d61804a8da21919e35ecc..9da13a6c5c7bdb2aea3f49a624eb523fcd4cebf7 100644 (file)
                IEEE80211_NODE_STAT(ni, rx_data);
                IEEE80211_NODE_STAT_ADD(ni, rx_bytes, skb->len);
                ic->ic_lastdata = jiffies;
-@@ -1114,6 +1142,17 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1114,6 +1142,18 @@ ieee80211_deliver_data(struct ieee80211_
                dev = vap->iv_xrvap->iv_dev;
  #endif
  
 +      if (ni->ni_subif && ((eh)->ether_type != __constant_htons(ETHERTYPE_PAE))) {
 +              if (ni->ni_vap == ni->ni_subif) {
 +                      ieee80211_dev_kfree_skb(&skb);
++                      return;
 +              } else {
 +                      vap = ni->ni_subif;
 +                      dev = vap->iv_dev;
        /* perform as a bridge within the vap */
        /* XXX intra-vap bridging only */
        if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
-@@ -1139,7 +1178,16 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1139,7 +1179,16 @@ ieee80211_deliver_data(struct ieee80211_
                        if (ni1 != NULL) {
                                if (ni1->ni_vap == vap &&
                                    ieee80211_node_is_authorized(ni1) &&
                                        skb1 = skb;
                                        skb = NULL;
                                }
-@@ -3084,8 +3132,7 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3084,8 +3133,7 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                    (vap->iv_opmode == IEEE80211_M_STA && ni->ni_associd) ||
                    (vap->iv_opmode == IEEE80211_M_IBSS) ||
                        ((subtype == IEEE80211_FC0_SUBTYPE_BEACON) &&
                        vap->iv_stats.is_rx_mgtdiscard++;
                        return;
                }
-@@ -3471,13 +3518,54 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3471,13 +3519,54 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                 */
                if (ic->ic_flags & IEEE80211_F_SCAN) {
                        ieee80211_add_scan(vap, &scan, wh, subtype, rssi, rtsf);
                        } else {
                                /*
                                 * Copy data from beacon to neighbor table.
-@@ -3490,6 +3578,7 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3490,6 +3579,7 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                                IEEE80211_ADDR_COPY(ni->ni_bssid, wh->i_addr3);
                                memcpy(ni->ni_tstamp.data, scan.tstamp,
                                        sizeof(ni->ni_tstamp));
index 1c31fff7f9eb894f5fabb4e77962952549123a36..aa32b1b227fda8fd5af7c4160b334d0cd6629480 100644 (file)
@@ -1,6 +1,6 @@
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -1197,6 +1197,7 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1198,6 +1198,7 @@ ieee80211_deliver_data(struct ieee80211_
                }
                if (skb1 != NULL) {
                        struct ieee80211_node *ni_tmp;
@@ -8,7 +8,7 @@
                        skb1->dev = dev;
                        skb_reset_mac_header(skb1);
                        skb_set_network_header(skb1, sizeof(struct ether_header));
-@@ -1204,7 +1205,12 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1205,7 +1206,12 @@ ieee80211_deliver_data(struct ieee80211_
                        skb1->protocol = __constant_htons(ETH_P_802_2);
                        /* XXX insert vlan tag before queue it? */
                        ni_tmp = SKB_CB(skb1)->ni; /* remember node so we can free it */
index 85183e6a71e99f5e5728be2ffc7f3e8c06ed7144..1d699a5ffa7e7a9c22bf085b6abedaa6de74c5b9 100644 (file)
@@ -1,6 +1,6 @@
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -3528,6 +3528,11 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3529,6 +3529,11 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                if (ic->ic_flags & IEEE80211_F_SCAN) {
                        ieee80211_add_scan(vap, &scan, wh, subtype, rssi, rtsf);
                }
index 1dc788e7d169474212853a6b4c5aad658de134d2..d74419bdb055e6f402566b14d5ca2e65e88cf475 100644 (file)
@@ -56,7 +56,7 @@
        /*
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -4017,7 +4017,26 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -4018,7 +4018,26 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                        vap->iv_stats.is_rx_assoc_norate++;
                        return;
                }
index 71d658b4e54f2f3785ef78f5b1266f32e3b57935..caad49c3d3fc8f335bf60083d7de5c58d7e78b51 100644 (file)
@@ -1,6 +1,6 @@
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -4440,7 +4440,9 @@ ath_eth_type_trans(struct sk_buff *skb, 
+@@ -4441,7 +4441,9 @@ ath_eth_type_trans(struct sk_buff *skb, 
                if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
                        skb->pkt_type = PACKET_OTHERHOST;
  
index b317be048260a3cd3abf3d67bfc64a1cf4011cb3..832f9e116209c736a88d4edfbb135804142be9dc 100644 (file)
@@ -1,6 +1,6 @@
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -1374,7 +1374,7 @@ ieee80211_auth_open(struct ieee80211_nod
+@@ -1375,7 +1375,7 @@ ieee80211_auth_open(struct ieee80211_nod
                vap->iv_stats.is_rx_bad_auth++; /* XXX maybe a unique error? */
                if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
                        if (ni == vap->iv_bss) {
@@ -9,7 +9,7 @@
                                if (ni == NULL)
                                        return;
                                tmpnode = 1;
-@@ -1762,6 +1762,8 @@ ieee80211_ssid_mismatch(struct ieee80211
+@@ -1763,6 +1763,8 @@ ieee80211_ssid_mismatch(struct ieee80211
  }
  
  #define       IEEE80211_VERIFY_SSID(_ni, _ssid) do {                          \
@@ -18,7 +18,7 @@
        if ((_ssid)[1] != 0 &&                                          \
            ((_ssid)[1] != (_ni)->ni_esslen ||                          \
            memcmp((_ssid) + 2, (_ni)->ni_essid, (_ssid)[1]) != 0)) {   \
-@@ -1776,6 +1778,8 @@ ieee80211_ssid_mismatch(struct ieee80211
+@@ -1777,6 +1779,8 @@ ieee80211_ssid_mismatch(struct ieee80211
  } while (0)
  #else /* !IEEE80211_DEBUG */
  #define       IEEE80211_VERIFY_SSID(_ni, _ssid) do {                          \
index d184fa2abb0ab491e6ebbd941e53001f8cbe65ed..71e11fa39a8cd2618507cbea75b6c28eb444ecff 100644 (file)
        if (skb != NULL)                /* no vaps, reclaim skb */
                ieee80211_dev_kfree_skb(&skb);
        return type;
-@@ -1146,11 +1157,9 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1147,11 +1158,9 @@ ieee80211_deliver_data(struct ieee80211_
                         * sending it will not work; just let it be
                         * delivered normally.
                         */
                                        !ni1->ni_subif &&
                                    ni1 != vap->iv_bss) {
  
-@@ -3519,6 +3528,7 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3520,6 +3529,7 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                                 (vap->iv_opmode == IEEE80211_M_WDS)) &&
                                (scan.capinfo & IEEE80211_CAPINFO_ESS))) {
                        struct ieee80211vap *avp = NULL;
                        int found = 0;
  
                        IEEE80211_LOCK_IRQ(vap->iv_ic);
-@@ -3550,10 +3560,12 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3551,10 +3561,12 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                                        ni->ni_associd |= 0xc000;
                                        avp->iv_wdsnode = ieee80211_ref_node(ni);
                                        IEEE80211_UNLOCK_IRQ(ic);
                        } else {
                                /*
                                 * Copy data from beacon to neighbor table.
-@@ -3592,6 +3604,8 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3593,6 +3605,8 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                                ni->ni_rssi = rssi;
                                ni->ni_rtsf = rtsf;
                                ni->ni_last_rx = jiffies;
index 1dd0bcd136ce1146efbb8c9df76a0018a53b9b08..becd4c99f5e0420b93717e49de43eefe19bc944e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -3618,6 +3618,8 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3619,6 +3619,8 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                        vap->iv_stats.is_rx_mgtdiscard++;
                        return;
                }
index 7ab5a1109411a5c5cddd897748c252d27d0c2f65..f84c4b4d77230f940a148c7424cb65b6112db2e2 100644 (file)
@@ -45,7 +45,7 @@
                local_irq_restore(flags);
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -1205,6 +1205,7 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1206,6 +1206,7 @@ ieee80211_deliver_data(struct ieee80211_
                }
        }
  
index 1899920a6014ba6663a14a595d8e3aa129ba5499..6e6d678fd49dd17d1c241c2b406f3eb1145d8797 100644 (file)
                ieee80211_stop(vap->iv_dev);
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -2774,6 +2774,7 @@ static void
+@@ -2775,6 +2775,7 @@ static void
  ieee80211_doth_switch_channel(struct ieee80211vap *vap)
  {
        struct ieee80211com *ic = vap->iv_ic;
  
        IEEE80211_DPRINTF(vap, IEEE80211_MSG_DOTH,
                          "%s: Channel switch to %3d (%4d MHz) NOW!\n",
-@@ -2796,6 +2797,9 @@ ieee80211_doth_switch_channel(struct iee
+@@ -2797,6 +2798,9 @@ ieee80211_doth_switch_channel(struct iee
  
        ic->ic_curchan = ic->ic_bsschan = vap->iv_csa_chan;
        ic->ic_set_channel(ic);
index 5764ab048a650802f66cf722b8837cf95057e24d..915b1a85d8cf3b9d7e5beab6aa8bf96021a46382 100644 (file)
@@ -170,7 +170,7 @@ http://madwifi-project.org/changeset/4005
  #endif
 --- a/net80211/ieee80211_input.c
 +++ b/net80211/ieee80211_input.c
-@@ -1187,7 +1187,11 @@ ieee80211_deliver_data(struct ieee80211_
+@@ -1188,7 +1188,11 @@ ieee80211_deliver_data(struct ieee80211_
                        skb1->protocol = __constant_htons(ETH_P_802_2);
                        /* XXX insert vlan tag before queue it? */
                        ni_tmp = SKB_CB(skb1)->ni; /* remember node so we can free it */
index 5894d68d5239238322561a1646ca0eb39589717d..b12cf6797d055e7b747f58d9181ed51fe6efd93f 100644 (file)
@@ -44,7 +44,7 @@
                        if (dir != IEEE80211_FC1_DIR_NODS) {
                                IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
                                        wh, "data", "invalid dir 0x%x", dir);
-@@ -3555,6 +3560,11 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3556,6 +3561,11 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                        } else if (vap->iv_opmode == IEEE80211_M_WDS) {
                                found = 1;
                                ni = ni_or_null = vap->iv_wdsnode;
@@ -56,7 +56,7 @@
                        }
                        IEEE80211_UNLOCK_IRQ(vap->iv_ic);
  
-@@ -3683,19 +3693,8 @@ ieee80211_recv_mgmt(struct ieee80211vap 
+@@ -3684,19 +3694,8 @@ ieee80211_recv_mgmt(struct ieee80211vap 
                        vap->iv_stats.is_rx_ssidmismatch++; /*XXX*/
                        return;
                }