summaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/files/hostapd.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-09-09 17:07:09 +0200
committerFelix Fietkau <nbd@nbd.name>2023-09-13 12:37:44 +0200
commit20c667cc88176552e4f5769051dff63819cd8177 (patch)
treea8b7cd01883b286b6d4ae73787f583ede89e828a /package/network/services/hostapd/files/hostapd.sh
parent651cb1422e52cd33a6aa0a409ffb196c65b01b6c (diff)
downloadopenwrt-20c667cc88176552e4f5769051dff63819cd8177.tar.gz
openwrt-20c667cc88176552e4f5769051dff63819cd8177.tar.bz2
openwrt-20c667cc88176552e4f5769051dff63819cd8177.zip
hostapd: rework reload support and MAC address handling
MAC address and interface name assigned by mac80211.sh depend on the order in which interfaces are brought up. This order changes when interfaces get added or removed, which can cause unnecessary reload churn. One part of the fix it making MAC address allocation more dynamic in both wpa_supplicant and hostapd, by ignoring the provided MAC address using the next available one, whenever the config does not explicitly specify one. The other part is making use of support for renaming netdevs at runtime and preserving the MAC address for renamed netdevs. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network/services/hostapd/files/hostapd.sh')
-rw-r--r--package/network/services/hostapd/files/hostapd.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index a0945fdc53..271c1f7bec 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -632,8 +632,7 @@ hostapd_set_bss_options() {
[ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N"
}
- set_default nasid "${macaddr//\:}"
- append bss_conf "nas_identifier=$nasid" "$N"
+ [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
[ -n "$acct_interval" ] && \
append bss_conf "radius_acct_interim_interval=$acct_interval" "$N"