diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-07-25 22:37:06 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-07-25 22:37:06 +0000 |
commit | 0e939a443a66ae3bbcbdc06799b43030d71cddf4 (patch) | |
tree | 913f43eb3df2725b14a65007a8b825a464adc903 | |
parent | dce707f29f2f6898d525b5adc8b0c175a9f21bb1 (diff) | |
download | upstream-0e939a443a66ae3bbcbdc06799b43030d71cddf4.tar.gz upstream-0e939a443a66ae3bbcbdc06799b43030d71cddf4.tar.bz2 upstream-0e939a443a66ae3bbcbdc06799b43030d71cddf4.zip |
madwifi: preserve WPA IEs received in probe responses and prefer them over beacon information
improves reliability when using wpa_supplicant to connect to aps with hidden ssid and dynamic
encryption settings
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11928 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/madwifi/patches/368-sta_ie_preserve.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/package/madwifi/patches/368-sta_ie_preserve.patch b/package/madwifi/patches/368-sta_ie_preserve.patch new file mode 100644 index 0000000000..7094a43258 --- /dev/null +++ b/package/madwifi/patches/368-sta_ie_preserve.patch @@ -0,0 +1,49 @@ +--- a/net80211/ieee80211_scan_sta.c ++++ b/net80211/ieee80211_scan_sta.c +@@ -201,8 +201,10 @@ + } + + static void +-saveie(u_int8_t **iep, const u_int8_t *ie) ++saveie(u_int8_t **iep, const u_int8_t *ie, int preserve) + { ++ if (preserve && *iep) ++ return; + if (ie == NULL) + *iep = NULL; + else +@@ -304,10 +306,10 @@ + (const struct ieee80211_tim_ie *) sp->tim; + ise->se_dtimperiod = tim->tim_period; + } +- saveie(&ise->se_wme_ie, sp->wme); +- saveie(&ise->se_wpa_ie, sp->wpa); +- saveie(&ise->se_rsn_ie, sp->rsn); +- saveie(&ise->se_ath_ie, sp->ath); ++ saveie(&ise->se_wme_ie, sp->wme, 0); ++ saveie(&ise->se_wpa_ie, sp->wpa, !sp->isprobe); ++ saveie(&ise->se_rsn_ie, sp->rsn, !sp->isprobe); ++ saveie(&ise->se_ath_ie, sp->ath, 0); + + /* clear failure count after STA_FAIL_AGE passes */ + if (se->se_fails && (jiffies - se->se_lastfail) > STA_FAILS_AGE*HZ) { +--- a/net80211/ieee80211_input.c ++++ b/net80211/ieee80211_input.c +@@ -3106,6 +3106,7 @@ + */ + IEEE80211_VERIFY_LENGTH(efrm - frm, 12); + memset(&scan, 0, sizeof(scan)); ++ scan.isprobe = (subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP) && IEEE80211_ADDR_EQ(wh->i_addr2, vap->iv_myaddr); + scan.tstamp = frm; + frm += 8; + scan.bintval = le16toh(*(__le16 *)frm); +--- a/net80211/ieee80211_scan.h ++++ b/net80211/ieee80211_scan.h +@@ -133,6 +133,7 @@ + u_int8_t erp; + u_int16_t bintval; + u_int8_t timoff; ++ u_int8_t isprobe; + u_int8_t *tim; + u_int8_t *tstamp; + u_int8_t *country; |