Skip to content

Commit e373a32

Browse files
committed
wpa_supplicant: use a timer to defer starting interfaces
This allows wpa_supplicant to process pending netlink socket messages first. Without this change, there is a race condition where the newly created interface processes netlink events from the removal of the previous interface. Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 3ab2f32 commit e373a32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package/network/services/hostapd/files/wpa_supplicant.uc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
let libubus = require("ubus");
2+
import * as uloop from "uloop";
23
import { open, readfile } from "fs";
34
import { wdev_create, wdev_set_mesh_params, wdev_remove, is_equal, wdev_set_up, vlist_new, phy_open } from "common";
45

@@ -549,7 +550,7 @@ let main_obj = {
549550
set_config(phy, req.args.phy, req.args.radio, req.args.num_global_macaddr, req.args.macaddr_base, req.args.config);
550551

551552
if (!req.args.defer)
552-
start_pending(phy);
553+
uloop.timer(100, () => start_pending(phy));
553554

554555
return {
555556
pid: wpas.getpid()

0 commit comments

Comments
 (0)