Possible problem in ucode wifi scripts

e9hack e9hack at gmail.com
Sat Dec 14 02:47:08 PST 2024


Hi,

it looks like that data.macaddr_base is always true even if no macaddr_base is set:

--- a/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc
+++ b/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc
@@ -213,7 +213,9 @@ const phy_proto = {
  		if (!base_mask)
  			return null;
  
-		if (base_mask == "00:00:00:00:00:00" &&
+		if (data.macaddr_base)
+			base_addr = data.macaddr_base;
+		else if (base_mask == "00:00:00:00:00:00" &&
  		    (radio_idx > 0 || idx >= num_global)) {
  			let addrs = split(phy_sysfs_file(phy, "addresses"), "\n");
  
Currently I'm using the following workaround:

--- a/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc
+++ b/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc
@@ -213,7 +213,9 @@ const phy_proto = {
  		if (!base_mask)
  			return null;
  
-		if (base_mask == "00:00:00:00:00:00" &&
+		if (data.macaddr_base != "null")
+			base_addr = data.macaddr_base;
+		else if (base_mask == "00:00:00:00:00:00" &&
  		    (radio_idx > 0 || idx >= num_global)) {
  			let addrs = split(phy_sysfs_file(phy, "addresses"), "\n");

Using of 'data.macaddr_base ?? 0' doesn't seem to work.
   
Regards,
Hartmut



More information about the openwrt-devel mailing list