PERFORCE change 139689 for review

Sam Leffler sam at FreeBSD.org
Wed Apr 9 23:28:29 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=139689

Change 139689 by sam at sam_ebb on 2008/04/09 23:27:44

	o record status/reason code for last auth failure, deauth, and
	  disassoc
	o move some checks up so we don't count frames we're going to drop

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_sta.c#9 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_sta.c#9 (text+ko) ====

@@ -928,6 +928,7 @@
 		IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH,
 		    ni, "open auth failed (reason %d)", status);
 		vap->iv_stats.is_rx_auth_fail++;
+		vap->iv_stats.is_rx_authfail_code = status;
 		ieee80211_new_state(vap, IEEE80211_S_SCAN,
 		    IEEE80211_SCAN_FAIL_STATUS);
 	} else
@@ -1023,6 +1024,7 @@
 			    IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, wh,
 			    "shared key auth failed (reason %d)", status);
 			vap->iv_stats.is_rx_auth_fail++;
+			vap->iv_stats.is_rx_authfail_code = status;
 			return;
 		}
 		ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0);
@@ -1564,20 +1566,23 @@
 			vap->iv_stats.is_rx_mgtdiscard++;
 			return;
 		}
+		if (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr)) {
+			/* NB: can happen when in promiscuous mode */
+			vap->iv_stats.is_rx_mgtdiscard++;
+			break;
+		}
+
 		/*
 		 * deauth frame format
 		 *	[2] reason
 		 */
 		IEEE80211_VERIFY_LENGTH(efrm - frm, 2, return);
 		reason = le16toh(*(uint16_t *)frm);
+
 		vap->iv_stats.is_rx_deauth++;
+		vap->iv_stats.is_rx_deauth_code = reason;
 		IEEE80211_NODE_STAT(ni, rx_deauth);
 
-		if (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr)) {
-			/* NB: can happen when in promiscuous mode */
-			vap->iv_stats.is_rx_mgtdiscard++;
-			break;
-		}
 		IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni,
 		    "recv deauthenticate (reason %d)", reason);
 		ieee80211_new_state(vap, IEEE80211_S_AUTH,
@@ -1594,20 +1599,23 @@
 			vap->iv_stats.is_rx_mgtdiscard++;
 			return;
 		}
+		if (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr)) {
+			/* NB: can happen when in promiscuous mode */
+			vap->iv_stats.is_rx_mgtdiscard++;
+			break;
+		}
+
 		/*
 		 * disassoc frame format
 		 *	[2] reason
 		 */
 		IEEE80211_VERIFY_LENGTH(efrm - frm, 2, return);
 		reason = le16toh(*(uint16_t *)frm);
+
 		vap->iv_stats.is_rx_disassoc++;
+		vap->iv_stats.is_rx_disassoc_code = reason;
 		IEEE80211_NODE_STAT(ni, rx_disassoc);
 
-		if (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr)) {
-			/* NB: can happen when in promiscuous mode */
-			vap->iv_stats.is_rx_mgtdiscard++;
-			break;
-		}
 		IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni,
 		    "recv disassociate (reason %d)", reason);
 		ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0);


More information about the p4-projects mailing list