[openwrt/openwrt] hostapd: allow ubus ban client address to be a broadcast address

LEDE Commits lede-commits at lists.infradead.org
Mon Dec 8 08:26:12 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7f05a9af9aebdc106a226cc41d20abfb53934a35

commit 7f05a9af9aebdc106a226cc41d20abfb53934a35
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Thu May 1 17:06:20 2025 +0000

    hostapd: allow ubus ban client address to be a broadcast address
    
    This will allow del_client with ban_time on a broadcast address
    to also ban all clients temporarily.
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/18670
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/hostapd/src/src/ap/ubus.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index 6c23078a69..c1d68c34ff 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -1849,6 +1849,7 @@ ubus_event_cb(struct ubus_notify_request *req, int idx, int ret)
 int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
 {
 	struct ubus_banned_client *ban;
+	const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 	const char *types[HOSTAPD_UBUS_TYPE_MAX] = {
 		[HOSTAPD_UBUS_PROBE_REQ] = "probe",
 		[HOSTAPD_UBUS_AUTH_REQ] = "auth",
@@ -1867,6 +1868,10 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
 	if (ban)
 		return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
 
+	ban = avl_find_element(&hapd->ubus.banned, bcast, ban, avl);
+	if (ban)
+		return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
+
 	if (!hapd->ubus.obj.has_subscribers)
 		return WLAN_STATUS_SUCCESS;
 




More information about the lede-commits mailing list