Просмотр исходного кода

wifi-scripts: ucode: set default wildcard mac for wifi-station

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]>
Oldřich Jedlička 5 месяцев назад
Родитель
Сommit
2146f5c31f

+ 2 - 0
package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh

@@ -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':

+ 2 - 1
package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-station.json

@@ -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",