Skip to content

Commit 70df0de

Browse files
committed
Search for match using correct IP protocol
1 parent 657a94f commit 70df0de

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/serverlist.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,11 @@ int CServerListManager::IndexOf ( const CHostAddress& haSearchTerm )
799799
// (i.e., this server).
800800
for ( int iIdx = ServerList.size() - 1; iIdx > 0; iIdx-- )
801801
{
802-
if ( ServerList[iIdx].HostAddr4 == haSearchTerm )
802+
if ( haSearchTerm.InetAddr.protocol() == QAbstractSocket::IPv4Protocol && ServerList[iIdx].HostAddr4 == haSearchTerm )
803+
{
804+
return iIdx;
805+
}
806+
if ( haSearchTerm.InetAddr.protocol() == QAbstractSocket::IPv6Protocol && ServerList[iIdx].HostAddr6 == haSearchTerm )
803807
{
804808
return iIdx;
805809
}

0 commit comments

Comments
 (0)