aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/lib80211_crypt_ccmp.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-13 17:56:26 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-15 13:45:03 -0400
commite87cc4728f0e2fb663e592a1141742b1d6c63256 (patch)
treeb8219696d37f0c8d0521d5853560b97fc96dc667 /net/wireless/lib80211_crypt_ccmp.c
parent3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c (diff)
net: Convert net_ratelimit uses to net_<level>_ratelimited
Standardize the net core ratelimited logging functions. Coalesce formats, align arguments. Change a printk then vprintk sequence to use printf extension %pV. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless/lib80211_crypt_ccmp.c')
-rw-r--r--net/wireless/lib80211_crypt_ccmp.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/net/wireless/lib80211_crypt_ccmp.c b/net/wireless/lib80211_crypt_ccmp.c
index 755738d26bb4..1526c211db66 100644
--- a/net/wireless/lib80211_crypt_ccmp.c
+++ b/net/wireless/lib80211_crypt_ccmp.c
@@ -304,10 +304,8 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
304 pos = skb->data + hdr_len; 304 pos = skb->data + hdr_len;
305 keyidx = pos[3]; 305 keyidx = pos[3];
306 if (!(keyidx & (1 << 5))) { 306 if (!(keyidx & (1 << 5))) {
307 if (net_ratelimit()) { 307 net_dbg_ratelimited("CCMP: received packet without ExtIV flag from %pM\n",
308 printk(KERN_DEBUG "CCMP: received packet without ExtIV" 308 hdr->addr2);
309 " flag from %pM\n", hdr->addr2);
310 }
311 key->dot11RSNAStatsCCMPFormatErrors++; 309 key->dot11RSNAStatsCCMPFormatErrors++;
312 return -2; 310 return -2;
313 } 311 }
@@ -318,11 +316,8 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
318 return -6; 316 return -6;
319 } 317 }
320 if (!key->key_set) { 318 if (!key->key_set) {
321 if (net_ratelimit()) { 319 net_dbg_ratelimited("CCMP: received packet from %pM with keyid=%d that does not have a configured key\n",
322 printk(KERN_DEBUG "CCMP: received packet from %pM" 320 hdr->addr2, keyidx);
323 " with keyid=%d that does not have a configured"
324 " key\n", hdr->addr2, keyidx);
325 }
326 return -3; 321 return -3;
327 } 322 }
328 323
@@ -336,15 +331,11 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
336 331
337 if (ccmp_replay_check(pn, key->rx_pn)) { 332 if (ccmp_replay_check(pn, key->rx_pn)) {
338#ifdef CONFIG_LIB80211_DEBUG 333#ifdef CONFIG_LIB80211_DEBUG
339 if (net_ratelimit()) { 334 net_dbg_ratelimited("CCMP: replay detected: STA=%pM previous PN %02x%02x%02x%02x%02x%02x received PN %02x%02x%02x%02x%02x%02x\n",
340 printk(KERN_DEBUG "CCMP: replay detected: STA=%pM " 335 hdr->addr2,
341 "previous PN %02x%02x%02x%02x%02x%02x " 336 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2],
342 "received PN %02x%02x%02x%02x%02x%02x\n", 337 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
343 hdr->addr2, 338 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
344 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2],
345 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
346 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
347 }
348#endif 339#endif
349 key->dot11RSNAStatsCCMPReplays++; 340 key->dot11RSNAStatsCCMPReplays++;
350 return -4; 341 return -4;
@@ -370,10 +361,8 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
370 } 361 }
371 362
372 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) { 363 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
373 if (net_ratelimit()) { 364 net_dbg_ratelimited("CCMP: decrypt failed: STA=%pM\n",
374 printk(KERN_DEBUG "CCMP: decrypt failed: STA=" 365 hdr->addr2);
375 "%pM\n", hdr->addr2);
376 }
377 key->dot11RSNAStatsCCMPDecryptErrors++; 366 key->dot11RSNAStatsCCMPDecryptErrors++;
378 return -5; 367 return -5;
379 } 368 }