]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
unetmsg: fix variable shadowing bug in network_rx_cleanup_state()
authorFelix Fietkau <nbd@nbd.name>
Fri, 2 Jan 2026 18:59:49 +0000 (18:59 +0000)
committerFelix Fietkau <nbd@nbd.name>
Fri, 2 Jan 2026 19:20:16 +0000 (20:20 +0100)
The for-in loop variable 'name' was shadowing the function parameter,
causing remote subscription cleanup to fail when hosts disconnect.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc

index 5dda32c13c8c2506c20225fcd9440d75d07cd2c1..59d9b0c278169ffabd3806411e5d4aa4c07a18fd 100644 (file)
@@ -49,10 +49,10 @@ function network_socket_close(data)
 
 function network_rx_cleanup_state(name)
 {
-       for (let name, sub in core.remote_subscribe)
+       for (let cur, sub in core.remote_subscribe)
                delete sub[name];
 
-       for (let name, sub in core.remote_publish)
+       for (let cur, sub in core.remote_publish)
                delete sub[name];
 }