Преглед на файлове

wifi-scripts: fix ucode erp_domain and fils_cache_id values

The ucode path generates different erp_domain and fils_cache_id
values than the legacy shell path due to three mismatches:

1. erp_domain md5 input missing trailing newline (echo adds \n)
2. erp_domain output truncated to 4 chars instead of 8 (shell
   uses head -c 8)
3. fils_cache_id md5 input missing trailing newline
4. erp_domain missing fallback to mobility_domain

Same bug pattern as mobility_domain fixed in commit b1dc2736db.

Fixes: #21768
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Joshua Klinesmith <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/22677
Signed-off-by: Hauke Mehrtens <[email protected]>
Joshua Klinesmith преди 1 седмица
родител
ревизия
b178e05d9b
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc

+ 3 - 2
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc

@@ -159,10 +159,11 @@ function iface_auth_type(config) {
 		config.vlan_possible = 1;
 
 		if (config.fils) {
-			set_default(config, 'erp_domain', substr(md5(config.ssid), 0, 4));
+			set_default(config, 'erp_domain', config.mobility_domain);
+			set_default(config, 'erp_domain', substr(md5(config.ssid + '\n'), 0, 8));
 			set_default(config, 'fils_realm', config.erp_domain);
 			set_default(config, 'erp_send_reauth_start', 1);
-			set_default(config, 'fils_cache_id', substr(md5(config.fils_realm), 0, 4));
+			set_default(config, 'fils_cache_id', substr(md5(config.fils_realm + '\n'), 0, 4));
 		}
 
 		if (!config.eap_server) {