diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6224,14 +6224,12 @@ } if (rx_status->flag & RX_FLAG_MMIC_STRIPPED) rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; - if (rx_status->flag & RX_FLAG_MIC_STRIPPED) { - /* net80211 re-uses M[ichael]MIC for MIC too. Confusing. */ - rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; - } + if (rx_status->flag & RX_FLAG_MMIC_ERROR) + rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MMIC; + if (rx_status->flag & RX_FLAG_MIC_STRIPPED) + rx_stats->c_pktflags |= IEEE80211_RX_F_MIC_STRIP; if (rx_status->flag & RX_FLAG_IV_STRIPPED) rx_stats->c_pktflags |= IEEE80211_RX_F_IV_STRIP; - if (rx_status->flag & RX_FLAG_MMIC_ERROR) - rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MIC; if (rx_status->flag & RX_FLAG_FAILED_FCS_CRC) rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC; #endif diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -585,16 +585,17 @@ #define IEEE80211_RX_F_AMPDU 0x00000010 /* This is the start of an decap AMPDU list */ #define IEEE80211_RX_F_AMPDU_MORE 0x00000020 /* This is another decap AMPDU frame in the batch */ #define IEEE80211_RX_F_FAIL_FCSCRC 0x00000040 /* Failed CRC/FCS */ -#define IEEE80211_RX_F_FAIL_MIC 0x00000080 /* Failed MIC check */ +#define IEEE80211_RX_F_FAIL_MMIC 0x00000080 /* Failed Michael MIC (MMIC) check */ #define IEEE80211_RX_F_DECRYPTED 0x00000100 /* Hardware decrypted */ #define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ -#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; [Micheal] MIC ([M]MIC) stripped */ +#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; Micheal MIC (MMIC) stripped */ #define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ #define IEEE80211_RX_F_CCK 0x00001000 #define IEEE80211_RX_F_OFDM 0x00002000 #define IEEE80211_RX_F_HT 0x00004000 #define IEEE80211_RX_F_VHT 0x00008000 #define IEEE80211_RX_F_PN_VALIDATED 0x00010000 /* Decrypted; PN validated */ +#define IEEE80211_RX_F_MIC_STRIP 0x00020000 /* Decrypted; MIC stripped */ /* Channel width */ #define IEEE80211_RX_FW_20MHZ 1 diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -791,9 +791,9 @@ * Handle demic / mic errors from hardware-decrypted offload devices. */ if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_DECRYPTED)) { - if (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MIC) { + if ((rxs->c_pktflags & IEEE80211_RX_F_FAIL_MMIC) != 0) { /* - * Hardware has said MIC failed. We don't care about + * Hardware has said MMIC failed. We don't care about * whether it was stripped or not. * * Eventually - teach the demic methods in crypto @@ -804,7 +804,8 @@ return (0); } - if (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) { + if ((rxs->c_pktflags & + (IEEE80211_RX_F_MIC_STRIP|IEEE80211_RX_F_MMIC_STRIP)) != 0) { /* * Hardware has decrypted and not indicated a * MIC failure and has stripped the MIC. diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -295,11 +295,7 @@ m_adj(m, ccmp.ic_header); } - /* - * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. - * Well no as it's a MIC not MMIC but we re-use the same flag for now. - */ - if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) == 0) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MIC_STRIP) == 0) m_adj(m, -ccmp.ic_trailer); /* @@ -683,10 +679,9 @@ } /* - * If the MIC (we use MMIC despite not being Micheal) was stripped - * by HW/driver we are done. + * If the MIC was stripped by HW/driver we are done. */ - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) != 0) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MIC_STRIP) != 0) return (1); if (memcmp(mic, a, ccmp.ic_trailer) != 0) { diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -394,7 +394,7 @@ * directly notify as a michael failure to the upper * layers. */ - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MIC)) { + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MMIC)) { struct ieee80211vap *vap = ctx->tc_vap; ieee80211_notify_michael_failure(vap, wh, k->wk_rxkeyix != IEEE80211_KEYIX_NONE ?