]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
unetmsg: ping on tx channel after new incoming connection
authorFelix Fietkau <nbd@nbd.name>
Mon, 12 May 2025 09:13:44 +0000 (11:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 12 May 2025 10:47:20 +0000 (12:47 +0200)
Ensure that stale connections are timed out faster

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

index cf92a67e138b0c2143f715a89e1d2c03d319013d..d905dbd349b576c4dd794fa28ab3a93760d8c2b1 100644 (file)
@@ -191,8 +191,18 @@ function network_check_auth(sock_data, info)
        sock_data.auth = true;
        net.rx_channels[sock_data.name] = sock_data;
        core.dbg(`Incoming connection from ${sock_data.name} established\n`);
-       if (!net.tx_channels[sock_data.name])
+
+       let chan = net.tx_channels[sock_data.name];
+       if (!chan) {
                net.timer.set(100);
+               return;
+       }
+
+       chan.channel.request({
+               method: "ping",
+               data: {},
+               return: "ignore",
+       });
 }
 
 function network_accept(net, sock, addr)