Skip to content

Commit

Permalink
FIX(client): Use IPv4 HostAddress representation where applicable
Browse files Browse the repository at this point in the history
In 6c56568 the HostAddress was refactored. A check for isV6 when
creating a QHostAddress was removed. However, the QHostAddress
determines the (IPv4 vs IPv6) distinction at construction time.
This resulted in some regressions both visually and functional.

This commit reintroduces the distinction.

Fixes mumble-voip#6349
  • Loading branch information
Hartmnt authored and mryamac committed Apr 6, 2024
1 parent 2a9b890 commit f53fec0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HostAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ bool HostAddress::isValid() const {
}

QHostAddress HostAddress::toAddress() const {
return QHostAddress(m_byteRepresentation.data());
QHostAddress address = QHostAddress(m_byteRepresentation.data());
if (!isV6()) {
address.setAddress(address.toIPv4Address());
}
return address;
}

QByteArray HostAddress::toByteArray() const {
Expand Down

0 comments on commit f53fec0

Please sign in to comment.