[openwrt/openwrt] hostapd: fix radius problem due to invalid attributes

LEDE Commits lede-commits at lists.infradead.org
Thu Jun 3 07:01:37 PDT 2021


blogic pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/96e9c81aabe9e14d6ec75c3f238c4ca7389b92a8

commit 96e9c81aabe9e14d6ec75c3f238c4ca7389b92a8
Author: John Crispin <john at phrozen.org>
AuthorDate: Thu Jun 3 15:57:07 2021 +0200

    hostapd: fix radius problem due to invalid attributes
    
    The offending commit caused the configuration file to contain:
      radius_auth_req_attr=
      radius_acct_req_attr=
    which cause hostapd to add an ATTR of type 0 into the messages.
    
    hostapd: RADIUS message: code=4 (Accounting-Request) identifier=0 length=93
    hostapd:    Attribute 40 (Acct-Status-Type) length=6
    hostapd:       Value: 7
    hostapd:    Attribute 30 (Called-Station-Id) length=28
    hostapd:       Value: 'C4-41-1E-F5-2D-55:OpenWifi'
    hostapd:    Attribute 61 (NAS-Port-Type) length=6
    hostapd:       Value: 19
    hostapd:    Attribute 0 (?Unknown?) length=3    <----------------
    hostapd:    Attribute 55 (Event-Timestamp) length=6
    hostapd:       Value: 1622726457
    hostapd:    Attribute 41 (Acct-Delay-Time) length=6
    hostapd:       Value: 0
    hostapd:    Attribute 44 (Acct-Session-Id) length=18
    hostapd:       Value: '9B5961E7235AAEC6'
    
    Fixes: 3bd6c8c728e (hostapd: add additional radius options)
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/network/services/hostapd/files/hostapd.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 7981f02ed6..1fa22cb69e 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -490,11 +490,11 @@ append_hs20_conn_capab() {
 }
 
 append_radius_acct_req_attr() {
-	append bss_conf "radius_acct_req_attr=$1" "$N"
+	[ -n "$1" ] && append bss_conf "radius_acct_req_attr=$1" "$N"
 }
 
 append_radius_auth_req_attr() {
-	append bss_conf "radius_auth_req_attr=$1" "$N"
+	[ -n "$1" ] && append bss_conf "radius_auth_req_attr=$1" "$N"
 }
 
 append_airtime_sta_weight() {



More information about the lede-commits mailing list