mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-10 08:44:39 +01:00
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@riseup.net> Link: https://github.com/openwrt/openwrt/pull/18670 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
5d7107ef63
commit
7f05a9af9a
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
|
||||||
{
|
{
|
||||||
struct ubus_banned_client *ban;
|
struct ubus_banned_client *ban;
|
||||||
|
const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||||
const char *types[HOSTAPD_UBUS_TYPE_MAX] = {
|
const char *types[HOSTAPD_UBUS_TYPE_MAX] = {
|
||||||
[HOSTAPD_UBUS_PROBE_REQ] = "probe",
|
[HOSTAPD_UBUS_PROBE_REQ] = "probe",
|
||||||
[HOSTAPD_UBUS_AUTH_REQ] = "auth",
|
[HOSTAPD_UBUS_AUTH_REQ] = "auth",
|
||||||
|
|
@ -1867,6 +1868,10 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
|
||||||
if (ban)
|
if (ban)
|
||||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
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)
|
if (!hapd->ubus.obj.has_subscribers)
|
||||||
return WLAN_STATUS_SUCCESS;
|
return WLAN_STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue