wifi-scripts: ucode: set default wildcard mac for wifi-station
authorOldřich Jedlička <[email protected]>
Tue, 29 Jul 2025 08:10:58 +0000 (10:10 +0200)
committerFelix Fietkau <[email protected]>
Tue, 2 Sep 2025 07:31:56 +0000 (09:31 +0200)
When creating the PSK file, the old script sets `mac` to
`00:00:00:00:00:00` when `mac` is not specified (see [here][1]),
creating hostapd configuration lines like:

  vlanid=10 00:00:00:00:00:00 MyStrongPassword

That matches any MAC address (a wildcard). The `ucode` script alternative
misses the default, so set it.

[1]: https://github.com/openwrt/openwrt/blob/9c26d144893c25e484ca97c7a3f58cdec6767465/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh#L428

Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-station.json

index e5d756d98821508c5f6b8a90aceb44a929f44afd..584a1423d3e13cec6716bbac3a29d288f805d076 100755 (executable)
@@ -233,6 +233,8 @@ function setup() {
                case 'link':
                case 'ap':
                        has_ap = true;
+                       for (let _, sta in v.stas)
+                               validate('station', sta.config);
                        // fallthrough
                case 'sta':
                case 'adhoc':
index dbad47abf4b0a71b2ca7a6d7cbbd1a79cd69451b..527c63c068f635c4142799a2284b255c38f4c949 100644 (file)
@@ -6,7 +6,8 @@
        "properties": {
                "mac": {
                        "description": "The stations MAC",
-                       "type": "string"
+                       "type": "string",
+                       "default": "00:00:00:00:00:00"
                },
                "key": {
                        "description": "The passphrase that shall be used",