mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-03-14 23:09:45 +01:00
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 212040b5ca)
This commit is contained in:
parent
69a4ca5e4a
commit
41ec0c16a7
1 changed files with 1 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue