VLAN: Reorder init to get same behavior for all VLAN interfaces
authorJouni Malinen <j@w1.fi>
Sat, 17 Apr 2010 06:48:27 +0000 (09:48 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 17 Apr 2010 06:48:27 +0000 (09:48 +0300)
Both the wildcard VLAN entry and the statically configured VLAN
interfaces should behave in the same way. Initializing the
full dynamic VLAN code before adding the statically configured VLAN
interfaces allows the same processing to be applied to both statically
and dynamically added VLAN interface (i.e., also the statically
configured ones will be added to a bridge).

src/ap/vlan_init.c

index dcfb1ff..aa07975 100644 (file)
@@ -800,13 +800,13 @@ static void vlan_dynamic_remove(struct hostapd_data *hapd,
 
 int vlan_init(struct hostapd_data *hapd)
 {
-       if (vlan_dynamic_add(hapd, hapd->conf->vlan))
-               return -1;
-
 #ifdef CONFIG_FULL_DYNAMIC_VLAN
        hapd->full_dynamic_vlan = full_dynamic_vlan_init(hapd);
 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
 
+       if (vlan_dynamic_add(hapd, hapd->conf->vlan))
+               return -1;
+
         return 0;
 }