Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 2004 03:13:10 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 67020 for review
Message-ID:  <200412140313.iBE3DAmU001665@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=67020

Change 67020 by sam@sam_ebb on 2004/12/14 03:12:31

	o fix mic pseudo hdr calculation for QoS frames
	o remove some XXX comments no longer needed
	o make debug msgs consistent

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_tkip.c#6 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_tkip.c#6 (text+ko) ====

@@ -200,7 +200,7 @@
 			return 0;
 		/* NB: tkip_encrypt handles wk_keytsc */
 	} else
-		k->wk_keytsc++;		/* XXX wrap at 48 bits */
+		k->wk_keytsc++;
 
 	return 1;
 }
@@ -264,7 +264,7 @@
 		 * No extended IV; discard frame.
 		 */
 		IEEE80211_DPRINTF(ctx->tc_ic, IEEE80211_MSG_CRYPTO,
-			"[%s] Missing ExtIV for TKIP cipher\n",
+			"[%s] missing ExtIV for TKIP cipher\n",
 			ether_sprintf(wh->i_addr2));
 		ctx->tc_ic->ic_stats.is_rx_tkipformat++;
 		return 0;
@@ -274,14 +274,13 @@
 	 */
 	if (ic->ic_flags & IEEE80211_F_COUNTERM) {
 		IEEE80211_DPRINTF(ic, IEEE80211_MSG_CRYPTO,
-			"[%s] Discard frame due to countermeasures (%s)\n",
+			"[%s] discard frame due to countermeasures (%s)\n",
 			ether_sprintf(wh->i_addr2), __func__);
 		ic->ic_stats.is_crypto_tkipcm++;
 		return 0;
 	}
 
-	ctx->rx_rsc = READ_6(ivp[2], ivp[0], ivp[4], ivp[5],
-		ivp[6], ivp[7]);
+	ctx->rx_rsc = READ_6(ivp[2], ivp[0], ivp[4], ivp[5], ivp[6], ivp[7]);
 	if (ctx->rx_rsc <= k->wk_keyrsc) {
 		/*
 		 * Replay violation; notify upper layer.
@@ -781,7 +780,12 @@
 		break;
 	}
 
-	hdr[12] = 0; /* XXX qos priority */
+	if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) {
+		const struct ieee80211_qosframe *qwh =
+			(const struct ieee80211_qosframe *) wh;
+		hdr[12] = qwh->i_qos[0] & IEEE80211_QOS_TID;
+	} else
+		hdr[12] = 0;
 	hdr[13] = hdr[14] = hdr[15] = 0; /* reserved */
 }
 
@@ -917,7 +921,7 @@
 		icv);
 	(void) m_append(m, IEEE80211_WEP_CRCLEN, icv);	/* XXX check return */
 
-	key->wk_keytsc++;		/* XXX wrap at 48 bits */
+	key->wk_keytsc++;
 	if ((u16)(key->wk_keytsc) == 0)
 		ctx->tx_phase1_done = 0;
 	return 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412140313.iBE3DAmU001665>