Skip to content

Commit ba9030c

Browse files
committed
mac80211: remove weak WEP IV accounting
Since WEP is practically dead, there seems very little point in keeping WEP weak IV accounting. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent b314c66 commit ba9030c

4 files changed

Lines changed: 1 addition & 25 deletions

File tree

‎net/mac80211/cfg.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
603603
}
604604

605605
static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = {
606-
"rx_packets", "rx_bytes", "wep_weak_iv_count",
606+
"rx_packets", "rx_bytes",
607607
"rx_duplicates", "rx_fragments", "rx_dropped",
608608
"tx_packets", "tx_bytes", "tx_fragments",
609609
"tx_filtered", "tx_retry_failed", "tx_retries",
@@ -651,7 +651,6 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy,
651651
do { \
652652
data[i++] += sta->rx_packets; \
653653
data[i++] += sta->rx_bytes; \
654-
data[i++] += sta->wep_weak_iv_count; \
655654
data[i++] += sta->num_duplicates; \
656655
data[i++] += sta->rx_fragments; \
657656
data[i++] += sta->rx_dropped; \

‎net/mac80211/debugfs_sta.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
587587
DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
588588
DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed);
589589
DEBUGFS_ADD_COUNTER(tx_retry_count, tx_retry_count);
590-
DEBUGFS_ADD_COUNTER(wep_weak_iv_count, wep_weak_iv_count);
591590

592591
if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
593592
debugfs_create_x32("driver_buffered_tids", 0400,

‎net/mac80211/sta_info.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ struct ieee80211_tx_latency_stat {
281281
* @driver_buffered_tids: bitmap of TIDs the driver has data buffered on
282282
* @rx_packets: Number of MSDUs received from this STA
283283
* @rx_bytes: Number of bytes received from this STA
284-
* @wep_weak_iv_count: number of weak WEP IVs received from this station
285284
* @last_rx: time (in jiffies) when last frame was received from this STA
286285
* @last_connected: time (in seconds) when a station got connected
287286
* @num_duplicates: number of duplicate frames received from this STA
@@ -369,7 +368,6 @@ struct sta_info {
369368
/* Updated from RX path only, no locking requirements */
370369
unsigned long rx_packets;
371370
u64 rx_bytes;
372-
unsigned long wep_weak_iv_count;
373371
unsigned long last_rx;
374372
long last_connected;
375373
unsigned long num_duplicates;

‎net/mac80211/wep.c‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -271,22 +271,6 @@ static int ieee80211_wep_decrypt(struct ieee80211_local *local,
271271
return ret;
272272
}
273273

274-
275-
static bool ieee80211_wep_is_weak_iv(struct sk_buff *skb,
276-
struct ieee80211_key *key)
277-
{
278-
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
279-
unsigned int hdrlen;
280-
u8 *ivpos;
281-
u32 iv;
282-
283-
hdrlen = ieee80211_hdrlen(hdr->frame_control);
284-
ivpos = skb->data + hdrlen;
285-
iv = (ivpos[0] << 16) | (ivpos[1] << 8) | ivpos[2];
286-
287-
return ieee80211_wep_weak_iv(iv, key->conf.keylen);
288-
}
289-
290274
ieee80211_rx_result
291275
ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx)
292276
{
@@ -301,16 +285,12 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx)
301285
if (!(status->flag & RX_FLAG_DECRYPTED)) {
302286
if (skb_linearize(rx->skb))
303287
return RX_DROP_UNUSABLE;
304-
if (rx->sta && ieee80211_wep_is_weak_iv(rx->skb, rx->key))
305-
rx->sta->wep_weak_iv_count++;
306288
if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key))
307289
return RX_DROP_UNUSABLE;
308290
} else if (!(status->flag & RX_FLAG_IV_STRIPPED)) {
309291
if (!pskb_may_pull(rx->skb, ieee80211_hdrlen(fc) +
310292
IEEE80211_WEP_IV_LEN))
311293
return RX_DROP_UNUSABLE;
312-
if (rx->sta && ieee80211_wep_is_weak_iv(rx->skb, rx->key))
313-
rx->sta->wep_weak_iv_count++;
314294
ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key);
315295
/* remove ICV */
316296
if (pskb_trim(rx->skb, rx->skb->len - IEEE80211_WEP_ICV_LEN))

0 commit comments

Comments
 (0)