]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
unetmsg: close all channels on network removal
authorFelix Fietkau <nbd@nbd.name>
Fri, 6 Feb 2026 09:30:49 +0000 (09:30 +0000)
committerFelix Fietkau <nbd@nbd.name>
Sat, 7 Feb 2026 09:04:17 +0000 (10:04 +0100)
network_close() only closed the listening socket without shutting down
established RX/TX connections. This left remote state in
core.remote_publish/core.remote_subscribe for hosts on the removed
network, causing stale entries in channel listings and failed routing
attempts.

Close all RX and TX channels before removing the network, which also
triggers remote state cleanup via network_rx_socket_close().

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

index 54e77596f16f9183898c4706619976a6289b7dee..f6b0ef2d5958d9c28a5bc06cb83f15c02afe9d19 100644 (file)
@@ -449,6 +449,13 @@ function network_close(name)
        net.timer.cancel();
        net.handle.delete();
        net.socket.close();
+
+       for (let peer, sock_data in net.rx_channels)
+               network_rx_socket_close(sock_data);
+
+       for (let peer, sock_data in net.tx_channels)
+               network_tx_socket_close(sock_data);
+
        delete networks[name];
 }