Files
wlan-ap/feeds/qca-wifi-7/hostapd/patches/r34-hostapd-add-ap-vlan-interface-to-bridge-after-interface-up.patch
John Crispin 68cf54d9f7 qca-wifi-7: update to ath12.5.5
Signed-off-by: John Crispin <john@phrozen.org>
2025-02-27 12:45:52 +01:00

70 lines
2.5 KiB
Diff

From 02ea2cf2c993d4f049d6b1464fc1ad954ab7b571 Mon Sep 17 00:00:00 2001
From: Radha Krishna Simha Jiguru <quic_rjiguru@quicinc.com>
Date: Thu, 11 Jul 2024 15:16:06 +0530
Subject: [PATCH] In current hostapd flow AP_VLAN net device is added to bridge
before interface is brought up.
Interface up event is used in mac80211 layer for setting device
context in vendor driver. Vendor datapath offload configurations for net device are
also setup in interface up event context.
Adding AP_VLAN interface to bridge before the UP event is causing
inconsistent state for datapath offload context setup in vendor driver.
Changed the sequence to add AP_VLAN interface to bridge after the interface is setup.
This change makes the interface up and bridge add
sequence for AP_VLAN to be consistent with that of regular VAP interface.
Signed-off-by: Radha Krishna Simha Jiguru <quic_rjiguru@quicinc.com>
Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
---
src/drivers/driver_nl80211.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8600,7 +8600,8 @@ static int i802_set_wds_sta(void *priv,
struct wpa_driver_nl80211_data *drv = bss->drv;
char name[IFNAMSIZ + 1];
union wpa_event_data event;
- int ret;
+ bool add_br = false;
+ int ret = 0;
ret = os_snprintf(name, sizeof(name), "%s.sta%d", bss->ifname, aid);
if (ret >= (int) sizeof(name))
@@ -8622,10 +8623,9 @@ static int i802_set_wds_sta(void *priv,
NL80211_IFTYPE_AP_VLAN,
bss->addr, 1, NULL, NULL, 0, 0) < 0)
return -1;
- if (bridge_ifname &&
- linux_br_add_if(drv->global->ioctl_sock,
- bridge_ifname, name) < 0)
- return -1;
+
+ if (bridge_ifname)
+ add_br = true;
os_memset(&event, 0, sizeof(event));
event.wds_sta_interface.sta_addr = addr;
@@ -8639,8 +8639,18 @@ static int i802_set_wds_sta(void *priv,
wpa_printf(MSG_ERROR, "nl80211: Failed to set WDS STA "
"interface %s up", name);
}
- return i802_set_sta_vlan(priv, addr, name, 0,
- NL80211_DRV_LINK_ID_NA);
+
+ ret = i802_set_sta_vlan(priv, addr, name, 0,
+ NL80211_DRV_LINK_ID_NA);
+ if (!ret && add_br &&
+ linux_br_add_if(drv->global->ioctl_sock,
+ bridge_ifname, name) < 0) {
+ wpa_printf(MSG_INFO,
+ "nl80211: Failed to add interface %s to bridge %s: %s",
+ name, bridge_ifname, strerror(errno));
+ return -1;
+ }
+ return ret;
} else {
if (bridge_ifname &&
linux_br_del_if(drv->global->ioctl_sock, bridge_ifname,