Clean up debug print for PSK file search

p2p_dev_addr was not NULL, so the all zeros case was printed as well.
Clean this up by printing p2p_dev_addr in debug prints only if it is a
real P2P Device Address.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-03-29 09:50:51 +02:00
parent b0159308b5
commit dc87541e1e

View file

@ -651,12 +651,11 @@ const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
struct hostapd_wpa_psk *psk;
int next_ok = prev_psk == NULL;
if (p2p_dev_addr) {
if (p2p_dev_addr && !is_zero_ether_addr(p2p_dev_addr)) {
wpa_printf(MSG_DEBUG, "Searching a PSK for " MACSTR
" p2p_dev_addr=" MACSTR " prev_psk=%p",
MAC2STR(addr), MAC2STR(p2p_dev_addr), prev_psk);
if (!is_zero_ether_addr(p2p_dev_addr))
addr = NULL; /* Use P2P Device Address for matching */
addr = NULL; /* Use P2P Device Address for matching */
} else {
wpa_printf(MSG_DEBUG, "Searching a PSK for " MACSTR
" prev_psk=%p",