From 2f9d49630d1b250bd8c9bb1202dc113fbb3cb20a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 17 Jan 2018 18:31:39 -0800 Subject: Examples: fix network-chat in the presence of an IPv6 stack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we bind to QHostAddress::Any, the incoming packets are actually IPv4-mapped IPv6 addresses and the operator== strict comparison was failing. Instead, use isEqual(), which defaults to TolerantComparison. Change-Id: Ic38ec929fc3f4bb795dafffd150ac6b3a0a7e3b2 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Edward Welbourne --- examples/network/network-chat/peermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/network') diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp index c70cc5e56d..07fd7f2a1a 100644 --- a/examples/network/network-chat/peermanager.cpp +++ b/examples/network/network-chat/peermanager.cpp @@ -108,7 +108,7 @@ void PeerManager::startBroadcasting() bool PeerManager::isLocalHostAddress(const QHostAddress &address) { foreach (QHostAddress localAddress, ipAddresses) { - if (address == localAddress) + if (address.isEqual(localAddress)) return true; } return false; -- cgit v1.2.3