Clean up l2_packet_get_own_addr() call

There is no need for this to be outside the if block that is used to
check whether l2_packet is used for the interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-04-19 16:15:18 +03:00
parent 9d6334e811
commit c3bb8865a0

View File

@ -4785,17 +4785,18 @@ int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
L2_PACKET_FILTER_PKTTYPE))
wpa_dbg(wpa_s, MSG_DEBUG,
"Failed to attach pkt_type filter");
if (l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) {
wpa_msg(wpa_s, MSG_ERROR,
"Failed to get own L2 address");
return -1;
}
} else {
const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
if (addr)
os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
}
if (wpa_s->l2 && l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) {
wpa_msg(wpa_s, MSG_ERROR, "Failed to get own L2 address");
return -1;
}
wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
wpas_wps_update_mac_addr(wpa_s);