Commit 27002657 authored by Max Kellermann's avatar Max Kellermann

net/SocketAddress: use IPv[46]Address::Cast()

parent 55709864
...@@ -95,13 +95,13 @@ SocketAddress::GetLocalPath() const noexcept ...@@ -95,13 +95,13 @@ SocketAddress::GetLocalPath() const noexcept
bool bool
SocketAddress::IsV6Any() const noexcept SocketAddress::IsV6Any() const noexcept
{ {
return GetFamily() == AF_INET6 && IPv6Address(*this).IsAny(); return GetFamily() == AF_INET6 && IPv6Address::Cast(*this).IsAny();
} }
bool bool
SocketAddress::IsV4Mapped() const noexcept SocketAddress::IsV4Mapped() const noexcept
{ {
return GetFamily() == AF_INET6 && IPv6Address(*this).IsV4Mapped(); return GetFamily() == AF_INET6 && IPv6Address::Cast(*this).IsV4Mapped();
} }
unsigned unsigned
...@@ -112,10 +112,10 @@ SocketAddress::GetPort() const noexcept ...@@ -112,10 +112,10 @@ SocketAddress::GetPort() const noexcept
switch (GetFamily()) { switch (GetFamily()) {
case AF_INET: case AF_INET:
return IPv4Address(*this).GetPort(); return IPv4Address::Cast(*this).GetPort();
case AF_INET6: case AF_INET6:
return IPv6Address(*this).GetPort(); return IPv6Address::Cast(*this).GetPort();
default: default:
return 0; return 0;
......
Markdown is supported
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