aboutsummaryrefslogtreecommitdiff
path: root/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2025-08-25 20:31:02 +0200
committerFelix Fietkau <nbd@nbd.name>2025-08-26 11:53:50 +0200
commit5bdb7a59906ee71d0178f78c4b3ce4c4ff4bb4e0 (patch)
treef111b8141f7786144277eda0394b3dc60ba514dd /package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
parent5781922f337c1e1e1518ba53cf8c9acdb6e26d03 (diff)
wifi-scripts: fix reload handling with random macaddrHEADmaster
Allow initially generated MAC address to be preserved across reload Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh')
-rwxr-xr-xpackage/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
index 2e939852b6..30d08a3015 100755
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
@@ -563,6 +563,7 @@ mac80211_hostapd_setup_bss() {
$hostapd_cfg
bssid=$macaddr
${default_macaddr:+#default_macaddr}
+${random_macaddr:+#random_macaddr}
${dtim_period:+dtim_period=$dtim_period}
${max_listen_int:+max_listen_interval=$max_listen_int}
EOF
@@ -691,12 +692,14 @@ mac80211_prepare_vif() {
json_add_string _ifname "$ifname"
default_macaddr=
+ random_macaddr=
if [ -z "$macaddr" ]; then
macaddr="$(mac80211_generate_mac $phy)"
macidx="$(($macidx + 1))"
default_macaddr=1
elif [ "$macaddr" = 'random' ]; then
macaddr="$(macaddr_random)"
+ random_macaddr=1
fi
json_add_string _macaddr "$macaddr"
json_add_string _default_macaddr "$default_macaddr"