From a9ec2fb9a4d924e52199e52a3a08e186cc25b94c Mon Sep 17 00:00:00 2001 From: Alhuda Khan Date: Sat, 24 Oct 2026 11:57:02 +0530 Subject: [PATCH] bouncedcc: connect to the bounce port via localhost in the test The bounce listener binds to the IRC socket's local address. With the inttest unix sockets that is "localhost" on Linux, which Csocket resolves to ::1, so connecting to 127.0.0.1 never reached it. --- test/integration/tests/modules.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/tests/modules.cpp b/test/integration/tests/modules.cpp index c09b97b3..8984f203 100644 --- a/test/integration/tests/modules.cpp +++ b/test/integration/tests/modules.cpp @@ -768,12 +768,14 @@ TEST_F(ZNCTest, BounceDCCModule) { // Only the user's own clients may connect to that bounce port. The test // client is on a unix socket, so a TCP connection from anywhere is refused. + // The listener binds to the IRC socket's local address, which for a unix + // socket is "localhost" on Linux and may resolve to ::1 only. QByteArray bouncePort = line2.mid(line2.lastIndexOf(' ') + 1); bouncePort.chop(1); // trailing \001 QTcpSocket outsider; - outsider.connectToHost("127.0.0.1", bouncePort.toUShort()); - outsider.waitForConnected(); - client.ReadUntil("Refused connection from 127.0.0.1"); + outsider.connectToHost("localhost", bouncePort.toUShort()); + ASSERT_TRUE(outsider.waitForConnected()); + client.ReadUntil("Refused connection from"); // Peer must not be able to make ZNC connect to its own loopback ircd.Write(":friend!user@host PRIVMSG nick :\001DCC CHAT chat 2130706433 6379\001");