diff options
| author | Felix Fietkau | 2026-02-06 10:12:31 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2026-02-16 08:09:16 +0000 |
| commit | 41ec0c16a7eb2a07666850cfa9062f4535b67e0d (patch) | |
| tree | acb4c7de7c6c1c6abae940c5bd7adc9b05d4da0f | |
| parent | 69a4ca5e4afdc122fa10ccd837ad0adafe17b642 (diff) | |
| download | openwrt-41ec0c16a7eb2a07666850cfa9062f4535b67e0d.tar.gz | |
unetmsg: fix reconnect loop when RX authenticates before TX
When both peers connect simultaneously, the RX side can authenticate
before the TX handshake completes. network_check_auth() was sending a
ping on the unauthenticated TX channel, which gets rejected by the
remote's pre-auth handler as "Auth failed", killing the connection and
triggering an endless reconnect cycle.
Check chan.auth before interacting with the TX channel. If TX auth
hasn't completed yet, just schedule a reconnect timer - auth_data_cb
already handles state sync when TX auth completes.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 212040b5cac619ec8009b0b4262d11b4e3abfdc4)
| -rw-r--r-- | package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc | 10 |
1 files changed, 1 insertions, 9 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 f6b0ef2d59..c7301e1a09 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 @@ -203,16 +203,8 @@ function network_check_auth(sock_data, info) core.dbg(`Incoming connection from ${sock_data.name} established\n`); let chan = net.tx_channels[sock_data.name]; - if (!chan) { + if (!chan || !chan.auth) net.timer.set(100); - return; - } - - chan.channel.request({ - method: "ping", - data: {}, - return: "ignore", - }); } function network_accept(net, sock, addr) |