Skip to content

Commit 1ee4482

Browse files
committed
wifi-scripts: fix mac address allocation with macaddr_base set
The 00 address_mask needs to be inverted, otherwise the mac address allocation will modify the last byte instead of the first one. Signed-off-by: Felix Fietkau <[email protected]>
1 parent 04570f5 commit 1ee4482

File tree

1 file changed

+4
-3
lines changed
  • package/network/config/wifi-scripts/files/usr/share/hostap

1 file changed

+4
-3
lines changed

package/network/config/wifi-scripts/files/usr/share/hostap/common.uc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,12 @@ const phy_proto = {
213213
if (!base_mask)
214214
return null;
215215

216+
if (base_mask == "00:00:00:00:00:00")
217+
base_mask = "ff:ff:ff:ff:ff:ff";
218+
216219
if (data.macaddr_base)
217220
base_addr = data.macaddr_base;
218-
else if (base_mask == "00:00:00:00:00:00" &&
221+
else if (base_mask == "ff:ff:ff:ff:ff:ff" &&
219222
(radio_idx > 0 || idx >= num_global)) {
220223
let addrs = split(phy_sysfs_file(phy, "addresses"), "\n");
221224

@@ -227,8 +230,6 @@ const phy_proto = {
227230
} else {
228231
if (idx < length(addrs))
229232
return addrs[idx];
230-
231-
base_mask = "ff:ff:ff:ff:ff:ff";
232233
}
233234
}
234235

0 commit comments

Comments
 (0)