diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index df8309269..1eaa36612 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -845,7 +845,9 @@ own_ip_addr=127.0.0.1 #vlan_tagged_interface=eth0 # Bridge (prefix) to add the wifi and the tagged interface to. This gets the -# VLAN ID appended. +# VLAN ID appended. It defaults to brvlan%d if no tagged interface is given +# and br%s.%d if a tagged interface is given, provided %s = tagged interface +# and %d = VLAN ID. #vlan_bridge=brvlan # When hostapd creates a VLAN interface on vlan_tagged_interfaces, it needs diff --git a/src/ap/vlan_init.c b/src/ap/vlan_init.c index e9ebcdd68..3cdd1a6a8 100644 --- a/src/ap/vlan_init.c +++ b/src/ap/vlan_init.c @@ -497,6 +497,10 @@ static void vlan_newlink(char *ifname, struct hostapd_data *hapd) os_snprintf(br_name, sizeof(br_name), "%s%d", hapd->conf->vlan_bridge, vlan->vlan_id); + } else if (tagged_interface) { + os_snprintf(br_name, sizeof(br_name), + "br%s.%d", tagged_interface, + vlan->vlan_id); } else { os_snprintf(br_name, sizeof(br_name), "brvlan%d", vlan->vlan_id); @@ -560,6 +564,10 @@ static void vlan_dellink(char *ifname, struct hostapd_data *hapd) os_snprintf(br_name, sizeof(br_name), "%s%d", hapd->conf->vlan_bridge, vlan->vlan_id); + } else if (tagged_interface) { + os_snprintf(br_name, sizeof(br_name), + "br%s.%d", tagged_interface, + vlan->vlan_id); } else { os_snprintf(br_name, sizeof(br_name), "brvlan%d", vlan->vlan_id);