Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74208
b: refs/heads/master
c: 92468c5
h: refs/heads/master
v: v3
  • Loading branch information
Guillaume Chazarain authored and John W. Linville committed Nov 20, 2007
1 parent d1dba69 commit b05bd60
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b50e388f88ab08f6c2f54f0a33e696ff2de269f
refs/heads/master: 92468c53cf5af0aea06caec7b7d416c18e973685
8 changes: 8 additions & 0 deletions trunk/include/net/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,16 @@ extern u32 ieee80211_debug_level;
do { if (ieee80211_debug_level & (level)) \
printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
static inline bool ieee80211_ratelimit_debug(u32 level)
{
return (ieee80211_debug_level & level) && net_ratelimit();
}
#else
#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
static inline bool ieee80211_ratelimit_debug(u32 level)
{
return false;
}
#endif /* CONFIG_IEEE80211_DEBUG */

/* escape_essid() is intended to be used in debug (and possibly error)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ieee80211/ieee80211_crypt_ccmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pos += 8;

if (ccmp_replay_check(pn, key->rx_pn)) {
if (net_ratelimit()) {
if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s "
"previous PN %02x%02x%02x%02x%02x%02x "
"received PN %02x%02x%02x%02x%02x%02x\n",
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ieee80211/ieee80211_crypt_tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pos += 8;

if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
if (net_ratelimit()) {
if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
" previous TSC %08x%04x received TSC "
"%08x%04x\n", print_mac(mac, hdr->addr2),
Expand Down Expand Up @@ -504,7 +504,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
* it needs to be recalculated for the next packet. */
tkey->rx_phase1_done = 0;
}
if (net_ratelimit()) {
if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
"%s\n", print_mac(mac, hdr->addr2));
}
Expand Down

0 comments on commit b05bd60

Please sign in to comment.