mpc85xx: refresh patches
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 710-vlan_no_bridge.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Tue, 18 May 2021 12:50:17 +0200
3 Subject: [PATCH] hostapd: add patch for disabling automatic bridging of vlan
4 interfaces
5
6 netifd is responsible for handling that, except if the vlan bridge
7 was provided by the config
8
9 --- a/hostapd/config_file.c
10 +++ b/hostapd/config_file.c
11 @@ -3559,6 +3559,8 @@ static int hostapd_config_fill(struct ho
12 #ifndef CONFIG_NO_VLAN
13 } else if (os_strcmp(buf, "dynamic_vlan") == 0) {
14 bss->ssid.dynamic_vlan = atoi(pos);
15 + } else if (os_strcmp(buf, "vlan_no_bridge") == 0) {
16 + bss->ssid.vlan_no_bridge = atoi(pos);
17 } else if (os_strcmp(buf, "per_sta_vif") == 0) {
18 bss->ssid.per_sta_vif = atoi(pos);
19 } else if (os_strcmp(buf, "vlan_file") == 0) {
20 --- a/src/ap/ap_config.h
21 +++ b/src/ap/ap_config.h
22 @@ -121,6 +121,7 @@ struct hostapd_ssid {
23 #define DYNAMIC_VLAN_OPTIONAL 1
24 #define DYNAMIC_VLAN_REQUIRED 2
25 int dynamic_vlan;
26 + int vlan_no_bridge;
27 #define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
28 #define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
29 #define DYNAMIC_VLAN_NAMING_END 2
30 --- a/src/ap/vlan_full.c
31 +++ b/src/ap/vlan_full.c
32 @@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, st
33 if (!vlan)
34 return;
35
36 + if (hapd->conf->ssid.vlan_no_bridge)
37 + goto out;
38 +
39 vlan->configured = 1;
40
41 notempty = vlan->vlan_desc.notempty;
42 @@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, st
43 ifname, br_name, tagged[i], hapd);
44 }
45
46 +out:
47 ifconfig_up(ifname);
48 }
49