X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Flistensocket.cpp;fp=src%2Flistensocket.cpp;h=71364238b4f420bf3806c60141e245fffd1d5408;hb=87e328a1fbfcacafc013ba580d31dd4123f1e7e2;hp=4ec6c2b0642453b7dfc31b9a563d7bec46e817d4;hpb=8f5952d1e56c9dbefebbacfc7e40546a9df901e8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 4ec6c2b06..71364238b 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -29,7 +29,7 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t : bind_tag(tag) , bind_sa(bind_to) { - fd = socket(bind_to.sa.sa_family, SOCK_STREAM, 0); + fd = socket(bind_to.family(), SOCK_STREAM, 0); if (this->fd == -1) return; @@ -41,7 +41,7 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t * is "::" or an IPv6 address, disable support so that an IPv4 bind will * work on the port (by us or another application). */ - if (bind_to.sa.sa_family == AF_INET6) + if (bind_to.family() == AF_INET6) { std::string addr = tag->getString("address"); /* This must be >= sizeof(DWORD) on Windows */ @@ -134,7 +134,7 @@ void ListenSocket::OnEventHandlerRead() ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "Can't get peername: %s", strerror(errno)); } - if (client.sa.sa_family == AF_INET6) + if (client.family() == AF_INET6) { /* * This case is the be all and end all patch to catch and nuke 4in6