hostapd: configure NAS ID regardless of encryption
authorYury Shvedov <yshvedov@wimarksystems.com>
Tue, 27 Jun 2017 08:43:54 +0000 (11:43 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Wed, 28 Jun 2017 00:18:20 +0000 (02:18 +0200)
RADIUS protocol could be used not only for authentication but for
accounting too. Accounting could be configured for any type of networks.
However there is no way to configure NAS Identifier for non-WPA
networks without this patch.

Signed-off-by: Yury Shvedov <yshvedov@wimarksystems.com>
[cleanup commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
package/network/services/hostapd/files/hostapd.sh

index d94aa38807e927301304c0cd6aa0687ff7b19d3d..8e3f88a115f479497f07bade0298168e242d1e19 100644 (file)
@@ -212,7 +212,7 @@ hostapd_set_bss_options() {
                wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \
                wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \
                macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
-               iapp_interface eapol_version dynamic_vlan ieee80211w \
+               iapp_interface eapol_version dynamic_vlan ieee80211w nasid \
                acct_server acct_secret acct_port acct_interval
 
        set_default isolate 0
@@ -249,6 +249,7 @@ hostapd_set_bss_options() {
                [ -n "$wpa_master_rekey" ] && append bss_conf "wpa_gmk_rekey=$wpa_master_rekey"  "$N"
        }
 
+       [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
        [ -n "$acct_server" ] && {
                append bss_conf "acct_server_addr=$acct_server" "$N"
                append bss_conf "acct_server_port=$acct_port" "$N"
@@ -376,9 +377,8 @@ hostapd_set_bss_options() {
        }
 
        if [ "$wpa" -ge "1" ]; then
-               json_get_vars nasid ieee80211r
+               json_get_vars ieee80211r
                set_default ieee80211r 0
-               [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
 
                if [ "$ieee80211r" -gt "0" ]; then
                        json_get_vars mobility_domain r0_key_lifetime r1_key_holder \