Revert portion of commit 3265 which introduced some poor

use of strncat (my bad) and needlessly complicated the debug 
output with prefixes.

Thanks, Pavel!  :-)



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3738 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mtaylor 2008-06-20 07:32:16 +00:00
parent 941d62b043
commit 3d91ef2071

View File

@ -3722,46 +3722,24 @@ ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix,
"CLR", "CLR",
}; };
unsigned int i, n; unsigned int i, n;
static const int MLEN = 1024;
static const int BLEN = 64;
char m[MLEN+1], b[BLEN+1];
m[MLEN] = '\0';
b[BLEN] = '\0';
snprintf(b, BLEN, "%s: [%02u] %-7s ",
tag, ix, ciphers[hk->kv_type]);
strncat(m, b, MLEN);
for (i = 0, n = hk->kv_len; i < n; i++) {
snprintf(b, BLEN, "%02x", hk->kv_val[i]);
strncat(m, b, MLEN);
}
snprintf(b, BLEN, " mac " MAC_FMT, MAC_ADDR(mac));
strncat(m, b, MLEN);
printk("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]);
for (i = 0, n = hk->kv_len; i < n; i++)
printk("%02x", hk->kv_val[i]);
printk(" mac " MAC_FMT, MAC_ADDR(mac));
if (hk->kv_type == HAL_CIPHER_TKIP) { if (hk->kv_type == HAL_CIPHER_TKIP) {
snprintf(b, BLEN, " %s ", printk(" %s ", sc->sc_splitmic ? "mic" : "rxmic");
sc->sc_splitmic ? "mic" : "rxmic"); for (i = 0; i < sizeof(hk->kv_mic); i++)
strncat(m, b, MLEN); printk("%02x", hk->kv_mic[i]);
for (i = 0; i < sizeof(hk->kv_mic); i++) {
snprintf(b, BLEN, "%02x", hk->kv_mic[i]);
strncat(m, b, MLEN);
}
#if HAL_ABI_VERSION > 0x06052200 #if HAL_ABI_VERSION > 0x06052200
if (!sc->sc_splitmic) { if (!sc->sc_splitmic) {
strncat(m, " txmic ", MLEN); printk(" txmic ");
for (i = 0; i < sizeof(hk->kv_txmic); i++) { for (i = 0; i < sizeof(hk->kv_txmic); i++)
snprintf(b, BLEN, printk("%02x", hk->kv_txmic[i]);
"%02x", hk->kv_txmic[i]);
strncat(m, b, MLEN);
}
} }
#endif #endif
} }
strncat(m, "\n", MLEN); printk("\n");
DPRINTF(sc, ATH_DEBUG_ANY, "%s", m);
} }
#endif #endif