mac80211: detect existing interface before adding
authorDaniel Golle <daniel@makrotopia.org>
Sat, 16 Nov 2019 15:29:45 +0000 (16:29 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sat, 16 Nov 2019 16:16:25 +0000 (17:16 +0100)
commitccf2aa9d4bf6b79669fc7121fa3bfe4c1e2b05c3
tree8346b9f55869ad0bc34d4d7698be184cefc54ac0
parent50d6e92619545d014639c68ea327cf7c6dd38695
mac80211: detect existing interface before adding

Keep existing wdev when creating new nl80211 interfaces if phy and
type match, delete it otherwise.
To make this work, also remove left-over debugging function which
prevented the return-value of the 'iw' command to be taken into
account in mac80211_iw_interface_add().
As 4addr-mode (WDS) was setup during interface creation for station
interfaces, also set it after interface creation to make sure an
existing sta interface ends up with the right mode.

Fixes: a5bc9787d4 ("mac80211: add support for dynamically
                    reconfiguring wifi")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh