VLAN: Fix bridge interface clean up for no tagged_interface case

This commit is contained in:
Jouni Malinen 2010-04-16 01:13:46 +03:00
parent 20e2cb0ae0
commit b9c3e576cb

View File

@ -526,7 +526,6 @@ static void vlan_dellink(char *ifname, struct hostapd_data *hapd)
char br_name[IFNAMSIZ];
struct hostapd_vlan *first, *prev, *vlan = hapd->conf->vlan;
char *tagged_interface = hapd->conf->ssid.vlan_tagged_interface;
int numports;
wpa_printf(MSG_DEBUG, "VLAN: vlan_dellink(%s)", ifname);
@ -537,20 +536,25 @@ static void vlan_dellink(char *ifname, struct hostapd_data *hapd)
os_snprintf(br_name, sizeof(br_name), "brvlan%d",
vlan->vlan_id);
if (vlan->clean & DVLAN_CLEAN_WLAN_PORT)
br_delif(br_name, vlan->ifname);
if (tagged_interface) {
os_snprintf(vlan_ifname, sizeof(vlan_ifname),
"vlan%d", vlan->vlan_id);
numports = br_getnumports(br_name);
if (numports == 1) {
if (vlan->clean & DVLAN_CLEAN_VLAN_PORT)
br_delif(br_name, vlan_ifname);
ifconfig_down(vlan_ifname);
if (vlan->clean & DVLAN_CLEAN_VLAN)
vlan_rem(vlan_ifname);
}
if ((vlan->clean & DVLAN_CLEAN_BR) &&
br_getnumports(br_name) == 0) {
ifconfig_down(br_name);
br_delbr(br_name);
}
}
if (vlan == first) {
hapd->conf->vlan = vlan->next;