mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-07 03:29:36 +00:00
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>
This commit is contained in:
parent
64b99802a6
commit
b8be20c7e8
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env ucode
|
#!/usr/bin/env ucode
|
||||||
'use strict';
|
'use strict';
|
||||||
import { vlist_new, is_equal, wdev_create, wdev_remove } from "/usr/share/hostap/common.uc";
|
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 keep_devices = {};
|
||||||
let phy = shift(ARGV);
|
let phy = shift(ARGV);
|
||||||
@ -106,6 +106,9 @@ function add_existing(phy, config)
|
|||||||
if (config[wdev])
|
if (config[wdev])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != phy)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (trim(readfile(`/sys/class/net/${wdev}/operstate`)) == "down")
|
if (trim(readfile(`/sys/class/net/${wdev}/operstate`)) == "down")
|
||||||
config[wdev] = {};
|
config[wdev] = {};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user