Date: Tue, 13 Feb 2007 15:00:44 GMT From: Sepherosa Ziehau <sephe@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 114453 for review Message-ID: <200702131500.l1DF0ih5043541@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114453 Change 114453 by sephe@sephe_zealot:sam_wifi on 2007/02/13 15:00:22 - Avoid 'goto' within 'switch' statement. - Strip trailing white space. - Correct two typos, which leads to possible NULL dereference. Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_input.c#83 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#83 (text+ko) ==== @@ -2467,6 +2467,7 @@ u_int16_t capinfo, lintval; struct ieee80211_rsnparms rsnparms; u_int8_t reason; + int badwparsn; if (ic->ic_opmode != IEEE80211_M_HOSTAP || ic->ic_state != IEEE80211_S_RUN) { @@ -2549,20 +2550,22 @@ return; } /* assert right association security credentials */ + badwparsn = 0; switch (ic->ic_flags & IEEE80211_F_WPA) { case IEEE80211_F_WPA1: if (wpa == NULL) - goto badwparsn; + badwparsn = 1; break; case IEEE80211_F_WPA2: if (rsn == NULL) - goto badwparsn; + badwparsn = 1; break; case IEEE80211_F_WPA1|IEEE80211_F_WPA2: - if (wpa != NULL || rsn != NULL) - break; - /* fall thru... */ - badwparsn: + if (wpa == NULL && rsn == NULL) + badwparsn = 1; + break; + } + if (badwparsn) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_WPA, "[%s] no WPA/RSN IE in association request\n", @@ -2572,7 +2575,7 @@ IEEE80211_REASON_RSN_REQUIRED); ieee80211_node_leave(ic, ni); ic->ic_stats.is_rx_assoc_badwpaie++; - return; + return; } if (wpa != NULL || rsn != NULL) { /* @@ -2586,7 +2589,7 @@ if (wpa != NULL) reason = ieee80211_parse_wpa(ic, wpa, &rsnparms, wh); else - reason = ieee80211_parse_rsn(ic, wpa, &rsnparms, wh); + reason = ieee80211_parse_rsn(ic, rsn, &rsnparms, wh); if (reason != 0) { IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_DEAUTH, reason); @@ -2673,7 +2676,7 @@ */ ni->ni_rsn = rsnparms; ieee80211_saveie(&ni->ni_rsn_ie, rsn); - } else if (ni->ni_wpa_ie != NULL) { + } else if (ni->ni_rsn_ie != NULL) { /* * Flush any state from a previous association. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702131500.l1DF0ih5043541>