nl80211: Fix del_ifidx() with mixed parent interface cases
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 27 May 2014 15:16:58 +0000 (18:16 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 27 May 2014 15:16:58 +0000 (18:16 +0300)
commitde88430311d6abbbcd32f792c42a9c73c1386667
tree9554a8f19e1b26e336266a013048886d13c4a33a
parent5e5818458f57a06a6be1e5c85ef5837d0428fa52
nl80211: Fix del_ifidx() with mixed parent interface cases

It is possible for a virtual interface to be added and removed by
different parent interfaces. This can happen, e.g., with P2P group
interfaces if the P2P parent interface does not happen to be the first
entry in the wpa_supplicant global interface list. That first entry is
used to remove the group interface while the addition would have
happened with the dedicated P2P management interface.

This can result in the interface that added a new virtual interface
getting stuck with an obsolete ifindex value in the drv->if_indeces list
and as such, deliver some extra events to incorrect destination wpa_s
instance. In particular, this can result in INTERFACE_DISABLED event
from deletion of a P2P group interface getting delivered incorrectly to
the parent wpa_s instance which would disable that interface even though
the interface remains in enabled state.

Fix this by clearing the removed interface from all if_indeces lists
instead of just the one that was used to delete the interface. This is
the simplest approach since the ifindex is unique and there is no need
to track which interface added the new virtual interface to always hit
the same one when removing the interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c