From 36d7f7c017ba6496b50a428678b98acabf973361 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 14 Sep 2009 10:45:34 +0000 Subject: [PATCH] madwifi: fix a wds related race condition SVN-Revision: 17578 --- package/madwifi/patches/370-wdsvap.patch | 11 ++++++----- package/madwifi/patches/372-queue_vif.patch | 4 ++-- package/madwifi/patches/378-adhoc_crash_fix.patch | 2 +- package/madwifi/patches/387-maxassoc.patch | 2 +- package/madwifi/patches/390-frame_type.patch | 2 +- package/madwifi/patches/391-vap_auth.patch | 6 +++--- package/madwifi/patches/393-mbss_vap_auth.patch | 8 ++++---- package/madwifi/patches/394-probereq.patch | 2 +- package/madwifi/patches/396-napi_ff_fix.patch | 2 +- package/madwifi/patches/411-autochannel_multi.patch | 4 ++-- package/madwifi/patches/432-netdev_ops.patch | 2 +- .../madwifi/patches/441-fix_ibss_node_handling.patch | 4 ++-- 12 files changed, 25 insertions(+), 24 deletions(-) diff --git a/package/madwifi/patches/370-wdsvap.patch b/package/madwifi/patches/370-wdsvap.patch index 488e7b2444..9da13a6c5c 100644 --- a/package/madwifi/patches/370-wdsvap.patch +++ b/package/madwifi/patches/370-wdsvap.patch @@ -748,7 +748,7 @@ 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 @@ -757,6 +757,7 @@ + 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; @@ -766,7 +767,7 @@ /* 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) && @@ -783,7 +784,7 @@ 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) && @@ -793,7 +794,7 @@ 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); @@ -853,7 +854,7 @@ } 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)); diff --git a/package/madwifi/patches/372-queue_vif.patch b/package/madwifi/patches/372-queue_vif.patch index 1c31fff7f9..aa32b1b227 100644 --- a/package/madwifi/patches/372-queue_vif.patch +++ b/package/madwifi/patches/372-queue_vif.patch @@ -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 */ diff --git a/package/madwifi/patches/378-adhoc_crash_fix.patch b/package/madwifi/patches/378-adhoc_crash_fix.patch index 85183e6a71..1d699a5ffa 100644 --- a/package/madwifi/patches/378-adhoc_crash_fix.patch +++ b/package/madwifi/patches/378-adhoc_crash_fix.patch @@ -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); } diff --git a/package/madwifi/patches/387-maxassoc.patch b/package/madwifi/patches/387-maxassoc.patch index 1dc788e7d1..d74419bdb0 100644 --- a/package/madwifi/patches/387-maxassoc.patch +++ b/package/madwifi/patches/387-maxassoc.patch @@ -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; } diff --git a/package/madwifi/patches/390-frame_type.patch b/package/madwifi/patches/390-frame_type.patch index 71d658b4e5..caad49c3d3 100644 --- a/package/madwifi/patches/390-frame_type.patch +++ b/package/madwifi/patches/390-frame_type.patch @@ -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; diff --git a/package/madwifi/patches/391-vap_auth.patch b/package/madwifi/patches/391-vap_auth.patch index b317be0482..832f9e1162 100644 --- a/package/madwifi/patches/391-vap_auth.patch +++ b/package/madwifi/patches/391-vap_auth.patch @@ -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 { \ diff --git a/package/madwifi/patches/393-mbss_vap_auth.patch b/package/madwifi/patches/393-mbss_vap_auth.patch index d184fa2abb..71e11fa39a 100644 --- a/package/madwifi/patches/393-mbss_vap_auth.patch +++ b/package/madwifi/patches/393-mbss_vap_auth.patch @@ -305,7 +305,7 @@ 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. */ @@ -319,7 +319,7 @@ !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; @@ -327,7 +327,7 @@ 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); @@ -341,7 +341,7 @@ } 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; diff --git a/package/madwifi/patches/394-probereq.patch b/package/madwifi/patches/394-probereq.patch index 1dd0bcd136..becd4c99f5 100644 --- a/package/madwifi/patches/394-probereq.patch +++ b/package/madwifi/patches/394-probereq.patch @@ -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; } diff --git a/package/madwifi/patches/396-napi_ff_fix.patch b/package/madwifi/patches/396-napi_ff_fix.patch index 7ab5a11094..f84c4b4d77 100644 --- a/package/madwifi/patches/396-napi_ff_fix.patch +++ b/package/madwifi/patches/396-napi_ff_fix.patch @@ -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_ } } diff --git a/package/madwifi/patches/411-autochannel_multi.patch b/package/madwifi/patches/411-autochannel_multi.patch index 1899920a60..6e6d678fd4 100644 --- a/package/madwifi/patches/411-autochannel_multi.patch +++ b/package/madwifi/patches/411-autochannel_multi.patch @@ -183,7 +183,7 @@ 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; @@ -191,7 +191,7 @@ 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); diff --git a/package/madwifi/patches/432-netdev_ops.patch b/package/madwifi/patches/432-netdev_ops.patch index 5764ab048a..915b1a85d8 100644 --- a/package/madwifi/patches/432-netdev_ops.patch +++ b/package/madwifi/patches/432-netdev_ops.patch @@ -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 */ diff --git a/package/madwifi/patches/441-fix_ibss_node_handling.patch b/package/madwifi/patches/441-fix_ibss_node_handling.patch index 5894d68d52..b12cf6797d 100644 --- a/package/madwifi/patches/441-fix_ibss_node_handling.patch +++ b/package/madwifi/patches/441-fix_ibss_node_handling.patch @@ -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; } -- 2.25.1