summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-01-04 10:07:33 +0000
committerFelix Fietkau2026-02-16 08:07:46 +0000
commit7b68399ecfe5ab2a6053519420861954c5480bc7 (patch)
tree735f31dd3378ab15a19023aec8b62937df5120fb
parente1728da72f5fc04c943b8240aab40988b212658b (diff)
downloadopenwrt-7b68399ecfe5ab2a6053519420861954c5480bc7.tar.gz
unetmsg: add timeout for outgoing auth requests
Add a 10-second timeout for outgoing auth requests to prevent connections from getting stuck when the remote peer goes silent after the hello handshake but before responding to auth. Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit 8a304d051f1a8b9b4193d9b25edddc0119c26b44)
-rw-r--r--package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc5
1 files changed, 5 insertions, 0 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 63be3cbab0..8901869ee2 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
@@ -307,6 +307,8 @@ function network_open_channel(net, name, peer)
if (!network_auth_valid(sock_data.name, sock_data.id, msg.token))
return;
+ if (sock_data.timer)
+ sock_data.timer.cancel();
sock_data.auth = true;
core.dbg(`Outgoing connection to ${name} established\n`);
@@ -344,6 +346,9 @@ function network_open_channel(net, name, peer)
data_cb: auth_data_cb,
cb: auth_cb,
});
+ sock_data.timer = uloop.timer(10 * 1000, () => {
+ network_tx_socket_close(sock_data);
+ });
return 0;
};