diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-08-03 18:47:15 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-08-03 18:51:00 +0200 |
commit | b8be20c7e81de2894df8fa2b361c39bc723e4cb5 (patch) | |
tree | 18829ef37de5a079011292658ad99596d008fbdb | |
parent | 64b99802a61a477ed23fc1f3426fb19d1bc0c6f3 (diff) | |
download | openwrt-b8be20c7e81de2894df8fa2b361c39bc723e4cb5.tar.gz openwrt-b8be20c7e81de2894df8fa2b361c39bc723e4cb5.tar.bz2 openwrt-b8be20c7e81de2894df8fa2b361c39bc723e4cb5.zip |
hostapd: fix unused device removal on DBDC devices
Check the phy before removing unrelated netdevs on the same hw device
Reported-by: Hartmut Birr <e9hack@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | package/network/services/hostapd/files/wdev.uc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/package/network/services/hostapd/files/wdev.uc b/package/network/services/hostapd/files/wdev.uc index 9701af125a..896f5261fb 100644 --- a/package/network/services/hostapd/files/wdev.uc +++ b/package/network/services/hostapd/files/wdev.uc @@ -1,7 +1,7 @@ #!/usr/bin/env ucode 'use strict'; import { vlist_new, is_equal, wdev_create, wdev_remove } from "/usr/share/hostap/common.uc"; -import { readfile, writefile, basename, glob } from "fs"; +import { readfile, writefile, basename, readlink, glob } from "fs"; let keep_devices = {}; let phy = shift(ARGV); @@ -106,6 +106,9 @@ function add_existing(phy, config) if (config[wdev]) continue; + if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != phy) + continue; + if (trim(readfile(`/sys/class/net/${wdev}/operstate`)) == "down") config[wdev] = {}; } |