[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
b9da0eba [MAC80211][misc][Fix duplicate mac address issue]
a5027f97 [mac80211][mt76][move temperature margin check to mt7915_thermal_temp_store()]
89c51e81 [MAC80211][hostapd][Fix per-user ru index in muru manual mode config commands]
c79eef80 [MAC80211][app][Add ATERUINFO wrap support]
11e7f687 [MAC80211][hostapd][Fix wds AP interface adding issue]
73f5c596 [MAC80211][misc][Set AP and STA BE TXOP to 2 ms]
6efe3657 [MAC80211][hostapd][rebase to the latest codebase]
8a84e107 [MAC80211][mt76][Add txpower info dump support]
02d01027 [MAC80211][hostapd][Fix no BSS load update issue]
ecd77be0 [MAC80211][core][Add dfs state check before extending CAC time for weather radar]
e28c8d9b [MAC80211][hostapd][Fix hostapd_dfs_start_cac log]
178e1786 [MAC80211][hostapd][rebase to the latest codebase]
3bc1e09e [mac80211][wed][add per-bss counter in mt76]
[Release-log]
Change-Id: Ia83661954b75bc6e339198125a7e60982b10e4f1
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0035-hostapd-mtk-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0035-hostapd-mtk-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
new file mode 100644
index 0000000..1937640
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0035-hostapd-mtk-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
@@ -0,0 +1,55 @@
+From 99159b174eb245a7162fe38900971cdff017cf75 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Thu, 13 Jul 2023 13:14:26 +0800
+Subject: [PATCH] hostapd: mtk: Check the bridge after ioctl SIOCBRADDIF failed
+
+If ioctl returns EBUSY on command SIOCBRADDIF, the interface might
+already be bridged by others, and linux_br_add_if should not indicate an
+error in the case.
+
+This patch checks whether the interface is correctly brigded when ioctl
+returns EBUSY.
+
+Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
+---
+ src/drivers/linux_ioctl.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/src/drivers/linux_ioctl.c b/src/drivers/linux_ioctl.c
+index 7edb9df..b8c1af2 100644
+--- a/src/drivers/linux_ioctl.c
++++ b/src/drivers/linux_ioctl.c
+@@ -150,7 +150,8 @@ int linux_br_del(int sock, const char *brname)
+ int linux_br_add_if(int sock, const char *brname, const char *ifname)
+ {
+ struct ifreq ifr;
+- int ifindex;
++ int ifindex, ret;
++ char in_br[IFNAMSIZ];
+
+ ifindex = if_nametoindex(ifname);
+ if (ifindex == 0)
+@@ -164,8 +165,19 @@ int linux_br_add_if(int sock, const char *brname, const char *ifname)
+
+ wpa_printf(MSG_DEBUG, "Could not add interface %s into bridge "
+ "%s: %s", ifname, brname, strerror(errno));
++
++ /* If ioctl returns -EBUSY when adding interface into bridge,
++ * the interface might already be added by netifd, so here we
++ * check whether the interface is currently on the right
++ * bridge. */
++ if(errno == EBUSY && linux_br_get(in_br, ifname) == 0 &&
++ os_strcmp(in_br, brname) == 0)
++ ret = 0;
++ else
++ ret = -1;
++
+ errno = saved_errno;
+- return -1;
++ return ret;
+ }
+
+ return 0;
+--
+2.25.1
+