Do not open l2_packet bridge workaround socket if control port is used

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>
This commit is contained in:
Jouni Malinen 2020-04-19 16:13:26 +03:00
parent 533d06340f
commit 9d6334e811

View 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) int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
{ {
if ((!wpa_s->p2p_mgmt || 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); os_memcpy(wpa_s->perm_addr, wpa_s->own_addr, ETH_ALEN);
wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr); 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 " wpa_dbg(wpa_s, MSG_DEBUG, "Receiving packets from bridge "
"interface '%s'", wpa_s->bridge_ifname); "interface '%s'", wpa_s->bridge_ifname);
wpa_s->l2_br = l2_packet_init_bridge( wpa_s->l2_br = l2_packet_init_bridge(