diff options
author | sam <sam@FreeBSD.org> | 2009-03-18 19:38:39 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-03-18 19:38:39 +0000 |
commit | 2235508d5eead1c1e8c9816bb780ba5a5ba0b588 (patch) | |
tree | 5fee62bb4014c155a83331a2e80de03c57497456 /sys/net80211/ieee80211_tdma.c | |
parent | 8bfd160665d6b36b087de434348dc376113ec6a6 (diff) | |
download | FreeBSD-src-2235508d5eead1c1e8c9816bb780ba5a5ba0b588.zip FreeBSD-src-2235508d5eead1c1e8c9816bb780ba5a5ba0b588.tar.gz |
rate limit printfs for invalid tdma ie contents; probably want this to
be less than 1/sec
Diffstat (limited to 'sys/net80211/ieee80211_tdma.c')
-rw-r--r-- | sys/net80211/ieee80211_tdma.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_tdma.c b/sys/net80211/ieee80211_tdma.c index 382507e..21d1bbd 100644 --- a/sys/net80211/ieee80211_tdma.c +++ b/sys/net80211/ieee80211_tdma.c @@ -387,8 +387,9 @@ tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma, update = 0; if (tdma->tdma_slotcnt != ts->tdma_slotcnt) { if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) { - printf("%s: bad slot cnt %u\n", - __func__, tdma->tdma_slotcnt); + if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) + printf("%s: bad slot cnt %u\n", + __func__, tdma->tdma_slotcnt); return 0; } update |= TDMA_UPDATE_SLOTCNT; @@ -396,16 +397,18 @@ tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma, slotlen = le16toh(tdma->tdma_slotlen) * 100; if (slotlen != ts->tdma_slotlen) { if (!TDMA_SLOTLEN_VALID(slotlen)) { - printf("%s: bad slot len %u\n", - __func__, slotlen); + if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) + printf("%s: bad slot len %u\n", + __func__, slotlen); return 0; } update |= TDMA_UPDATE_SLOTLEN; } if (tdma->tdma_bintval != ts->tdma_bintval) { if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) { - printf("%s: bad beacon interval %u\n", - __func__, tdma->tdma_bintval); + if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) + printf("%s: bad beacon interval %u\n", + __func__, tdma->tdma_bintval); return 0; } update |= TDMA_UPDATE_BINTVAL; |