Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clientrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ CClientRpc::CClientRpc ( CClient* pClient, CClientSettings* pSettings, CRpcServe
CHostAddress haDirectoryAddress;

// Allow IPv4 only for communicating with Directories
if ( NetworkUtil::ParseNetworkAddress ( jsonDirectoryIp.toString(), haDirectoryAddress, false ) )
if ( NetworkUtil::ParseNetworkAddress ( jsonDirectoryIp.toString(), haDirectoryAddress, pClient->IsIPv6Available() ) )
{
// send the request for the server list
pClient->CreateCLReqServerListMes ( haDirectoryAddress );
Expand Down
2 changes: 1 addition & 1 deletion src/connectdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void CConnectDlg::RequestServerList()
if ( NetworkUtil::ParseNetworkAddress (
NetworkUtil::GetDirectoryAddress ( pSettings->eDirectoryType, pSettings->vstrDirectoryAddress[pSettings->iCustomDirectoryIndex] ),
haDirectoryAddress,
false ) )
pClient->IsIPv6Available() ) )
{
// send the request for the server list
emit ReqServerListQuery ( haDirectoryAddress );
Expand Down
2 changes: 1 addition & 1 deletion src/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ LED bar: lbr
#define MAX_LEN_CHAT_TEXT 1600
#define MAX_LEN_CHAT_TEXT_PLUS_HTML 1800
#define MAX_LEN_SERVER_NAME 20
#define MAX_LEN_IP_ADDRESS 15
#define MAX_LEN_IP_ADDRESS 39 // 15 for IPv4, 39 for IPv6
#define MAX_LEN_SERVER_CITY 20
#define MAX_LEN_VERSION_TEXT 50

Expand Down
15 changes: 13 additions & 2 deletions src/serverlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ void CServerListManager::SetRegistered ( const bool bIsRegister )
// Allow IPv4 only for communicating with Directories
// Use SRV DNS discovery for directory connections, fallback to A/AAAA if none.
const QString strNetworkAddress = NetworkUtil::GetDirectoryAddress ( DirectoryType, strDirectoryAddress );
const bool bDirectoryAddressValid = NetworkUtil::ParseNetworkAddress ( strNetworkAddress, DirectoryAddress, false );
const bool bDirectoryAddressValid = NetworkUtil::ParseNetworkAddress ( strNetworkAddress, DirectoryAddress, pServer->IsIPv6Available() );

// lock the mutex again now that the address has been resolved.
locker.relock();
Expand All @@ -1027,7 +1027,18 @@ void CServerListManager::SetRegistered ( const bool bIsRegister )
// For a registered server, the server properties are stored in the
// very first item in the server list (which is actually no server list
// but just one item long for the registered server).
pConnLessProtocol->CreateCLRegisterServerExMes ( DirectoryAddress, ServerList[0].LHostAddr, ServerList[0] );
if ( DirectoryAddress.InetAddr.protocol() == QAbstractSocket::IPv4Protocol )
{
pConnLessProtocol->CreateCLRegisterServerExMes ( DirectoryAddress, ServerPublicIP, ServerList[0] );
}
else if ( DirectoryAddress.InetAddr.protocol() == QAbstractSocket::IPv6Protocol )
{
pConnLessProtocol->CreateCLRegisterServerExMes ( DirectoryAddress, ServerPublicIP6, ServerList[0] );
}
else
{
SetSvrRegStatus ( SRS_BAD_ADDRESS );
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/serverlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CServerListEntry : public CServerInfo
QString strCountry,
QString strNumClients,
bool isPermanent,
bool bEnableIPv6 );
bool bIPv6Available );
QString toCSV();

// time on which the entry was registered
Expand Down
Loading