Commit bbb9d0ff authored by Joris Guisson's avatar Joris Guisson
Browse files

Fix compile error in ktorrent due to missing function

parent b1aea416
......@@ -177,6 +177,18 @@ namespace net
return addr[10] == 0xff && addr[11] == 0xff;
}
Address Address::convertIPv4Mapped() const
{
if (isIPv4Mapped())
{
Q_IPV6ADDR ipv6 = toIPv6Address();
quint32 ip = ipv6[12] << 24 | ipv6[13] << 16 | ipv6[14] << 8 | ipv6[15];
return net::Address(ip, port());
}
return net::Address(*this);
}
}
......@@ -77,6 +77,9 @@ namespace net
/// Is this a IPv4 mapped address into the IPv6 address space
bool isIPv4Mapped() const;
/// Convert to an IPv4 address when isIPv4Mapped returns true
Address convertIPv4Mapped() const;
private:
Uint16 port_number;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment