]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not open l2_packet bridge workaround socket if control port is used
authorJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 13:13:26 +0000 (16:13 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 13:50:56 +0000 (16:50 +0300)
This allows wpa_supplicant to avoid the packet socket workaround for
cases where a bridge interface is used if the driver supports control
port for EAPOL frame TX and RX.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index 6a69ccebf6952342aa0f1e7d0bc165e2b91b7019..1941efa90b5541c80441ef5bfee696a9d25e6123 100644 (file)
@@ -4761,6 +4761,13 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
 }
 
 
+static int wpas_eapol_needs_l2_packet(struct wpa_supplicant *wpa_s)
+{
+       return !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_CONTROL_PORT) ||
+               !(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX);
+}
+
+
 int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
 {
        if ((!wpa_s->p2p_mgmt ||
@@ -4847,7 +4854,7 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
        os_memcpy(wpa_s->perm_addr, wpa_s->own_addr, ETH_ALEN);
        wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
 
-       if (wpa_s->bridge_ifname[0]) {
+       if (wpa_s->bridge_ifname[0] && wpas_eapol_needs_l2_packet(wpa_s)) {
                wpa_dbg(wpa_s, MSG_DEBUG, "Receiving packets from bridge "
                        "interface '%s'", wpa_s->bridge_ifname);
                wpa_s->l2_br = l2_packet_init_bridge(