meta-netmodule-wlan/recipes-connectivity/hostapd/files/710-vlan_no_bridge.patch

58 lines
1.8 KiB
Diff

From d8aa8cfd9e47a553bd8f20b8fa20eed153d76704 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:28 +0000
---
hostapd/config_file.c | 2 ++
src/ap/ap_config.h | 1 +
src/ap/vlan_full.c | 4 ++++
3 files changed, 7 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 67b385ded..7fcbb0be3 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3342,6 +3342,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
#ifndef CONFIG_NO_VLAN
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
bss->ssid.dynamic_vlan = atoi(pos);
+ } else if (os_strcmp(buf, "vlan_no_bridge") == 0) {
+ bss->ssid.vlan_no_bridge = atoi(pos);
} else if (os_strcmp(buf, "per_sta_vif") == 0) {
bss->ssid.per_sta_vif = atoi(pos);
} else if (os_strcmp(buf, "vlan_file") == 0) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index e4340952e..6884d30be 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -121,6 +121,7 @@ struct hostapd_ssid {
#define DYNAMIC_VLAN_OPTIONAL 1
#define DYNAMIC_VLAN_REQUIRED 2
int dynamic_vlan;
+ int vlan_no_bridge;
#define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
#define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
#define DYNAMIC_VLAN_NAMING_END 2
diff --git a/src/ap/vlan_full.c b/src/ap/vlan_full.c
index 19aa3c649..053d6338e 100644
--- a/src/ap/vlan_full.c
+++ b/src/ap/vlan_full.c
@@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, struct hostapd_data *hapd)
if (!vlan)
return;
+ if (hapd->conf->ssid.vlan_no_bridge)
+ goto out;
+
vlan->configured = 1;
notempty = vlan->vlan_desc.notempty;
@@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, struct hostapd_data *hapd)
ifname, br_name, tagged[i], hapd);
}
+out:
ifconfig_up(ifname);
}