bridge: Track inter-BSS usage
authorMichael Braun <michael-dev@fami-braun.de>
Tue, 25 Jun 2013 08:55:30 +0000 (11:55 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 25 Jun 2013 09:00:10 +0000 (12:00 +0300)
commit4345fe963e7bc6461b7547766d47fd4722d72130
tree7bfe117e540b5929708374e1c1b031adbc1302c1
parent459eee923c02675890e9cc94086da8866180c944
bridge: Track inter-BSS usage

Currently, struct hostapd_vlan is a per-BSS data structure which
also contains informations about whether to remove the bridge
or clear wlan / tagged-vlan interface from the bridge.

In a multi-interface multi-BSS setup, this can lead to the following
race condition:
 1. wlan0 creates VLAN A, sets DVLAN_CLEAN_BR and DVLAN_CLEAN_VLAN_PORT
 2. wlan1 creates VLAN A, does not set DVLAN_CLEAN_BR and
    DVLAN_CLEAN_VLAN_PORT as already there
 3. wlan0 removes VLAN A, removes tagged-interface from the bridge
    but not the bridge.
    Now wlan1 VLAN A is unusable due to the missing uplink.
 4. wlan1 removes VLAN A, does not cleanup

Solution:
This requires an inter-BSS inter-interface data structure to track the
bridge / bridge port usage within hostapd. This data structure could
also be used to track any other device-has-been-created-by-hostapd
information or when regarding interface freeing.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>
src/ap/hostapd.h
src/ap/vlan_init.c