710-vlan_no_bridge.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From: Felix Fietkau <[email protected]>
  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. netifd is responsible for handling that, except if the vlan bridge
  6. was provided by the config
  7. --- a/hostapd/config_file.c
  8. +++ b/hostapd/config_file.c
  9. @@ -3415,6 +3415,8 @@ static int hostapd_config_fill(struct ho
  10. #ifndef CONFIG_NO_VLAN
  11. } else if (os_strcmp(buf, "dynamic_vlan") == 0) {
  12. bss->ssid.dynamic_vlan = atoi(pos);
  13. + } else if (os_strcmp(buf, "vlan_no_bridge") == 0) {
  14. + bss->ssid.vlan_no_bridge = atoi(pos);
  15. } else if (os_strcmp(buf, "per_sta_vif") == 0) {
  16. bss->ssid.per_sta_vif = atoi(pos);
  17. } else if (os_strcmp(buf, "vlan_file") == 0) {
  18. --- a/src/ap/ap_config.h
  19. +++ b/src/ap/ap_config.h
  20. @@ -120,6 +120,7 @@ struct hostapd_ssid {
  21. #define DYNAMIC_VLAN_OPTIONAL 1
  22. #define DYNAMIC_VLAN_REQUIRED 2
  23. int dynamic_vlan;
  24. + int vlan_no_bridge;
  25. #define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
  26. #define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
  27. #define DYNAMIC_VLAN_NAMING_END 2
  28. --- a/src/ap/vlan_full.c
  29. +++ b/src/ap/vlan_full.c
  30. @@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, st
  31. if (!vlan)
  32. return;
  33. + if (hapd->conf->ssid.vlan_no_bridge)
  34. + goto out;
  35. +
  36. vlan->configured = 1;
  37. notempty = vlan->vlan_desc.notempty;
  38. @@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, st
  39. ifname, br_name, tagged[i], hapd);
  40. }
  41. +out:
  42. ifconfig_up(ifname);
  43. }