bandwidth: Correct handling of RADIUS-assigned bandwidth

limits

Description:
Hostapd successfully parsed the uplink and downlink bandwidth attributes from
the RADIUS server, but the values were not being propagated correctly into
sta_info. As a result, the bandwidth information was missing in the UBUS
events sent to ucentral-event.

Fix:
Ensure the parsed bandwidth values are correctly passed to sta_info so they
 are included in subsequent UBUS notifications.

Tests Performed:
Configured per-client bandwidth limits on the RADIUS server and verified that:

 - The AP enforces the configured uplink/downlink limits, and
 - The correct bandwidth values appear in the UBUS events.

Signed-off-by: Venkat Chimata <venkat@nearhop.com>
This commit is contained in:
Venkat Chimata 2025-12-11 10:54:19 +05:30
parent d5374d4e14
commit 5c3d876b1d

View File

@ -0,0 +1,69 @@
From c2e1dbd799ae5ed166e9c84a3c3d3a07a8f8cc9b Mon Sep 17 00:00:00 2001
From: Venkat Chimata <venkat@nearhop.com>
Date: Thu, 11 Dec 2025 10:38:07 +0530
Subject: [PATCH] bandwidth: Correct handling of RADIUS-assigned bandwidth
limits
Description:
Hostapd successfully parsed the uplink and downlink bandwidth attributes from
the RADIUS server, but the values were not being propagated correctly into
sta_info. As a result, the bandwidth information was missing in the UBUS
events sent to ucentral-event.
Fix:
Ensure the parsed bandwidth values are correctly passed to sta_info so they
are included in subsequent UBUS notifications.
Tests Performed:
Configured per-client bandwidth limits on the RADIUS server and verified that:
- The AP enforces the configured uplink/downlink limits, and
- The correct bandwidth values appear in the UBUS events.
Signed-off-by: Venkat Chimata <venkat@nearhop.com>
---
src/ap/ieee802_11.c | 2 ++
src/ap/ieee802_11_auth.c | 1 +
src/ap/ieee802_11_auth.h | 1 +
3 files changed, 4 insertions(+)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index ef1ad21..615fb32 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -2485,6 +2485,8 @@ int ieee802_11_set_radius_info(struct hostapd_data *hapd, struct sta_info *sta,
ap_sta_no_session_timeout(hapd, sta);
}
+ os_memcpy(sta->bandwidth, info->bandwidth, sizeof(sta->bandwidth));
+
return 0;
}
diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c
index e673296..9d0d734 100644
--- a/src/ap/ieee802_11_auth.c
+++ b/src/ap/ieee802_11_auth.c
@@ -581,6 +581,7 @@ hostapd_acl_recv_radius(struct radius_msg *msg, struct radius_msg *req,
os_memcpy(info->radius_cui, buf, len);
}
+ radius_msg_get_wispr(msg, info->bandwidth);
if (hapd->conf->wpa_psk_radius == PSK_RADIUS_REQUIRED &&
!info->psk)
cache->accepted = HOSTAPD_ACL_REJECT;
diff --git a/src/ap/ieee802_11_auth.h b/src/ap/ieee802_11_auth.h
index 22ae1a9..b0005bd 100644
--- a/src/ap/ieee802_11_auth.h
+++ b/src/ap/ieee802_11_auth.h
@@ -23,6 +23,7 @@ struct radius_sta {
struct hostapd_sta_wpa_psk_short *psk;
char *identity;
char *radius_cui;
+ u32 bandwidth[2];
};
int hostapd_check_acl(struct hostapd_data *hapd, const u8 *addr,
--
2.34.1