diff options
author | Max Kellermann <max@musicpd.org> | 2018-10-30 20:19:04 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-10-30 20:19:04 +0100 |
commit | e575392b9461d7f975b198b8886e89dc60542825 (patch) | |
tree | 6cfb51d03895774760ae8faa2489f0fff087bf79 /src/event/ServerSocket.cxx | |
parent | c6f61a699c7518b33860e692f201fd6383a4979c (diff) |
event/ServerSocket: use class IPv6Address
Diffstat (limited to 'src/event/ServerSocket.cxx')
-rw-r--r-- | src/event/ServerSocket.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index 10d7aef2f..dbec53d17 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -20,6 +20,7 @@ #include "config.h" #include "ServerSocket.hxx" #include "net/IPv4Address.hxx" +#include "net/IPv6Address.hxx" #include "net/StaticSocketAddress.hxx" #include "net/AllocatedSocketAddress.hxx" #include "net/SocketAddress.hxx" @@ -316,12 +317,7 @@ ServerSocket::AddPortIPv4(unsigned port) noexcept inline void ServerSocket::AddPortIPv6(unsigned port) noexcept { - struct sockaddr_in6 sin; - memset(&sin, 0, sizeof(sin)); - sin.sin6_port = htons(port); - sin.sin6_family = AF_INET6; - - AddAddress({(const sockaddr *)&sin, sizeof(sin)}); + AddAddress(IPv6Address(port)); } /** |