From 57b86c71cead0be8497cde28e5dfec144f982430 Mon Sep 17 00:00:00 2001
From: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
Date: Mon, 14 Mar 2022 14:25:41 +0100
Subject: [PATCH] don't add bhaul AP to the bridge

As long as we need only 4addr mode stations
we don't need to add this to the bridge.

brcm will create:
 - wdsX.X.X netdev per station
mac80211/hostapd will create:
 - wlan1_1.sta1 netdev per station

For mac80211 based drivers - in such case hostapd
will not add wlan1_1.sta1 to the bridge (automatically).

Next we could/should do correct action base on that.
In case of no vlans we can simply add netdev
stations to the bridge.

In case of vlans/guest vlan requirement we can/should
create:
 - wdsX.X.X_tagY
 - wdsX.X.X_tagZ
 - wlan1_1.sta1_tagY
 - wlan1_1.sta1_tagZ

and put to the correct bridge.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
---
 src/config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/config.c b/src/config.c
index e31b36f0d..24b75983c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1239,8 +1239,11 @@ int uci_apply_m2(struct agent_config *cfg, char *interface_name, char *device,
 		} while(0);
 	}
 
-	uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
-			interface_name, "network", bridge);
+	if (multi_ap != 1) {
+		uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
+				interface_name, "network", bridge);
+	}
+
 	uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
 			interface_name, "ssid", (char *) ssid);
 	uci_set_wireless_interface_option(UCI_WIRELESS, UCI_WLAN_IFACE, "ifname",
-- 
GitLab