Commit e575392b authored by Max Kellermann's avatar Max Kellermann

event/ServerSocket: use class IPv6Address

parent c6f61a69
......@@ -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));
}
/**
......
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