]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Do not open EAPOL RX socket when using control port for RX (AP)
authorJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 13:25:27 +0000 (16:25 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 14:42:41 +0000 (17:42 +0300)
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>
src/drivers/driver_nl80211.c

index 0ffb14dc7529f3896500c4d02c0c86aadfb2001d..e221e58677da0b7d63b8fd228f0d368d7c208edb 100644 (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))