route_replies + irssi localhost'd into znc will cause irssi to disconnect under certain conditions. #718

Closed
opened 2026-10-05 04:40:27 +02:00 by adam · 2 comments
Owner

Not sure if its irssi bug or not, but route_replies said report it...

irssi <---> localhost <---> znc

irssi will stay connected to znc while attempting to connect to chat.fake.net since it does not exist.
https://dl.dropboxusercontent.com/u/16148324/znc/irssi-route-replies-attempting-server.txt

irssi will lose connection to znc while attempting to connect toirc.freenude.net (domain squatting?) after a few minutes.
https://dl.dropboxusercontent.com/u/16148324/znc/irssi-route-replies-attempting-server2.txt

mIRC <---> localhost <---> znc

mIRC just stays connected in both cases
https://dl.dropboxusercontent.com/u/16148324/znc/mirc-route-replies-attempting-server.txt
https://dl.dropboxusercontent.com/u/16148324/znc/mirc-route-replies-attempting-server2.txt

znc.conf
https://dl.dropboxusercontent.com/u/16148324/znc/znc-2016-07-28.conf

user@localhost ~ $ znc --version
ZNC 1.7.x-git-623-f1ef8c7 - http://znc.in
IPv6: yes, SSL: yes, DNS: threads, charset: yes, build: autoconf, i18n: no**

./configure --prefix=/usr --enable-perl --enable-python --enable-debug --enable-tcl --enable-cyrus

user@localhost ~ $ irssi --version
irssi 0.8.20-g3e28bf7 (20160717 1237)

./configure --prefix=/usr --enable-silent-rules --enable-true-color --with-socks --with-bot --with-proxy

mIRC 7.45.769 Beta.

user@localhost ~ $ ping chat.fake.net
ping: chat.fake.net: No address associated with hostname
user@localhost ~ $ ping irc.freenude.net
PING irc.freenude.net (199.59.243.120) 56(84) bytes of data.
^C
--- irc.freenude.net ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5039ms
Not sure if its irssi bug or not, but route_replies said report it... irssi <---> localhost <---> znc irssi will stay connected to znc while attempting to connect to `chat.fake.net` since it does not exist. https://dl.dropboxusercontent.com/u/16148324/znc/irssi-route-replies-attempting-server.txt irssi will lose connection to znc while attempting to connect to`irc.freenude.net` (domain squatting?) after a few minutes. https://dl.dropboxusercontent.com/u/16148324/znc/irssi-route-replies-attempting-server2.txt mIRC <---> localhost <---> znc mIRC just stays connected in both cases https://dl.dropboxusercontent.com/u/16148324/znc/mirc-route-replies-attempting-server.txt https://dl.dropboxusercontent.com/u/16148324/znc/mirc-route-replies-attempting-server2.txt znc.conf https://dl.dropboxusercontent.com/u/16148324/znc/znc-2016-07-28.conf user@localhost ~ $ znc --version ZNC 1.7.x-git-623-f1ef8c7 - http://znc.in IPv6: yes, SSL: yes, DNS: threads, charset: yes, build: autoconf, i18n: no** `./configure --prefix=/usr --enable-perl --enable-python --enable-debug --enable-tcl --enable-cyrus` user@localhost ~ $ irssi --version irssi 0.8.20-g3e28bf7 (20160717 1237) `./configure --prefix=/usr --enable-silent-rules --enable-true-color --with-socks --with-bot --with-proxy` mIRC 7.45.769 Beta. ``` user@localhost ~ $ ping chat.fake.net ping: chat.fake.net: No address associated with hostname user@localhost ~ $ ping irc.freenude.net PING irc.freenude.net (199.59.243.120) 56(84) bytes of data. ^C --- irc.freenude.net ping statistics --- 6 packets transmitted, 0 received, 100% packet loss, time 5039ms ``` <!-- github-sync-id:168182248 -->
adam closed this issue 2026-10-05 04:40:27 +02:00
Author
Owner

ZNC:

2016-07-28 08:24:08.386000 CLI -> ZNC [PING irc.znc.in]
2016-07-28 08:24:08.386231 ZNC -> IRC [PING irc.znc.in]
2016-07-28 08:25:08.387244 ZNC -> CLI [:*route_replies!znc@znc.in PRIVMSG foobar :This module hit a timeout which is probably a connectivity issue.]

Irssi:

08:29:09 -!- Irssi: No PONG reply from server localhost in 301 seconds, disconnecting

Normally, ZNC answers PINGs and everything would be fine. However, the route_replies module overrides ZNCs normal PING handling and tries to handle the reply from the server. Since ZNC is not connected to any server, the PING gets lost and is never answered.

route_replies tries to handle this, but the check is slightly wrong:
https://github.com/znc/znc/blob/8f73840e7445bd5b58e92ec3b4c75e1945a3f3c3/modules/route_replies.cpp#L297

(This check will also match "we are connected to a server" while the connection is being established).
I'd propose to replace the above with

if (!GetNetwork()->GetIRCSock() || !GetNetwork()->GetIRCSock()->IsConnected()) return CONTINUE;
ZNC: > [2016-07-28 08:24:08.386000](KindOne/freenode) CLI -> ZNC [PING irc.znc.in] > [2016-07-28 08:24:08.386231](KindOne/freenode) ZNC -> IRC [PING irc.znc.in] > [2016-07-28 08:25:08.387244](KindOne/freenode) ZNC -> CLI [:*route_replies!znc@znc.in PRIVMSG foobar :This module hit a timeout which is probably a connectivity issue.] Irssi: > 08:29:09 -!- Irssi: No PONG reply from server localhost in 301 seconds, disconnecting Normally, ZNC answers PINGs and everything would be fine. However, the `route_replies` module overrides ZNCs normal PING handling and tries to handle the reply from the server. Since ZNC is not connected to any server, the PING gets lost and is never answered. `route_replies` tries to handle this, but the check is slightly wrong: https://github.com/znc/znc/blob/8f73840e7445bd5b58e92ec3b4c75e1945a3f3c3/modules/route_replies.cpp#L297 (This check will also match "we are connected to a server" while the connection is being established). I'd propose to replace the above with ``` c++ if (!GetNetwork()->GetIRCSock() || !GetNetwork()->GetIRCSock()->IsConnected()) return CONTINUE; ``` <!-- github-comment-id:236127513 -->
Author
Owner
Tested with mIRC and irssi, the change works. https://dl.dropboxusercontent.com/u/16148324/znc/irssi-znc-route-replies-patch.txt https://dl.dropboxusercontent.com/u/16148324/znc/irssi-znc-route-replies-patch2.txt <!-- github-comment-id:236155536 -->
adam changed title from route_replies + irssi localhost'd into znc will cause irssi to disconnect under certain conditions. to route_replies + irssi localhost'd into znc will cause irssi to disconnect under certain conditions. 2026-10-27 15:12:02 +01:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#718