nl80211: Do not open EAPOL RX socket when using control port for RX (AP)

drv->eapol_sock is used only for receiving EAPOL frames in AP mode, so
it is not needed when using control port for EAPOL frame RX.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-04-19 16:25:27 +03:00
parent e480ed38eb
commit 95cbf45090
1 changed files with 7 additions and 0 deletions

View File

@ -7288,6 +7288,12 @@ static void *i802_init(struct hostapd_data *hapd,
}
#endif /* CONFIG_LIBNL3_ROUTE */
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
wpa_printf(MSG_DEBUG,
"nl80211: Do not open EAPOL RX socket - using control port for RX");
goto skip_eapol_sock;
}
drv->eapol_sock = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_PAE));
if (drv->eapol_sock < 0) {
wpa_printf(MSG_ERROR, "nl80211: socket(PF_PACKET, SOCK_DGRAM, ETH_P_PAE) failed: %s",
@ -7300,6 +7306,7 @@ static void *i802_init(struct hostapd_data *hapd,
wpa_printf(MSG_INFO, "nl80211: Could not register read socket for eapol");
goto failed;
}
skip_eapol_sock:
if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname,
params->own_addr))