From: Felix Fietkau Date: Thu, 30 Oct 2025 19:44:38 +0000 (+0000) Subject: wpa_supplicant: add support for issuing control socket commands via ubus X-Git-Tag: v25.12.0-rc1~715 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ab2f32006514549525e4d29136eab813017d96e;p=thirdparty%2Fopenwrt.git wpa_supplicant: add support for issuing control socket commands via ubus This makes it possible to have more flexible control over the supplicant without having to install wpa_cli. Signed-off-by: Felix Fietkau --- diff --git a/package/network/services/hostapd/files/wpa_supplicant.uc b/package/network/services/hostapd/files/wpa_supplicant.uc index b77e0648e93..20613ae702d 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.uc +++ b/package/network/services/hostapd/files/wpa_supplicant.uc @@ -773,6 +773,20 @@ function iface_ubus_add(ifname) return 0; }, }, + control: { + args: { + command: "" + }, + call: (req) => { + let iface = wpas.interfaces[ifname]; + if (!iface) + return libubus.STATUS_NOT_FOUND; + + return { + result: iface.ctrl(req.args.command) + }; + }, + }, }); wpas.data.iface_ubus[ifname] = obj; }