summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2025-05-12 09:13:44 +0000
committerFelix Fietkau2025-05-12 10:47:20 +0000
commit9bdbe24176ca32925e4aaa3f8650d5eb11fdfc5f (patch)
treed4772bde32d48d04b363a96ae9c829d5b21d6c6b
parent929702fdc514c0ec77e93a407be741aa5e375b1e (diff)
downloadopenwrt-9bdbe24176ca32925e4aaa3f8650d5eb11fdfc5f.tar.gz
unetmsg: ping on tx channel after new incoming connection
Ensure that stale connections are timed out faster Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc12
1 files changed, 11 insertions, 1 deletions
diff --git a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
index cf92a67e13..d905dbd349 100644
--- a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
+++ b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
@@ -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)