]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: fix ucode erp_domain and fils_cache_id values 22677/head
authorJoshua Klinesmith <joshuaklinesmith@gmail.com>
Sun, 29 Mar 2026 20:19:40 +0000 (16:19 -0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 3 Apr 2026 22:18:31 +0000 (00:18 +0200)
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) <noreply@anthropic.com>
Signed-off-by: Joshua Klinesmith <joshuaklinesmith@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22677
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc

index d95cbdb4d856a87c4ec3270f378067aade1abb7e..032a434281d6f1e74b250f1196330e59ef8acdde 100644 (file)
@@ -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) {