Skip to content

Commit

Permalink
wifi-scripts: fix mac address allocation with macaddr_base set
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nbd168 committed Feb 11, 2025
1 parent 04570f5 commit 1ee4482
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,12 @@ const phy_proto = {
if (!base_mask)
return null;

if (base_mask == "00:00:00:00:00:00")
base_mask = "ff:ff:ff:ff:ff:ff";

if (data.macaddr_base)
base_addr = data.macaddr_base;
else if (base_mask == "00:00:00:00:00:00" &&
else if (base_mask == "ff:ff:ff:ff:ff:ff" &&
(radio_idx > 0 || idx >= num_global)) {
let addrs = split(phy_sysfs_file(phy, "addresses"), "\n");

Expand All @@ -227,8 +230,6 @@ const phy_proto = {
} else {
if (idx < length(addrs))
return addrs[idx];

base_mask = "ff:ff:ff:ff:ff:ff";
}
}

Expand Down

0 comments on commit 1ee4482

Please sign in to comment.