From fb13dca410541f01db84287f2721d1e256eaf2b5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 28 Aug 2017 15:37:15 +0100 Subject: Store the server endpoint as a sockaddrs in ListenSocket. --- src/socket.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/socket.cpp') diff --git a/src/socket.cpp b/src/socket.cpp index 0ba57a810..a5c1c679a 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -45,12 +45,11 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports) irc::sockets::sockaddrs bindspec; if (!irc::sockets::aptosa(Addr, portno, bindspec)) continue; - std::string bind_readable = bindspec.str(); bool skip = false; for (std::vector::iterator n = old_ports.begin(); n != old_ports.end(); ++n) { - if ((**n).bind_desc == bind_readable) + if ((**n).bind_sa == bindspec) { (*n)->bind_tag = tag; // Replace tag, we know addr and port match, but other info (type, ssl) may not (*n)->ResetIOHookProvider(); @@ -71,7 +70,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports) } else { - failed_ports.push_back(std::make_pair(bind_readable, strerror(errno))); + failed_ports.push_back(std::make_pair(bindspec.str(), strerror(errno))); delete ll; } } @@ -90,7 +89,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports) } this->Logs->Log("SOCKET", LOG_DEFAULT, "Port binding %s was removed from the config file, closing.", - (**n).bind_desc.c_str()); + (**n).bind_sa.str().c_str()); delete *n; // this keeps the iterator valid, pointing to the next element -- cgit v1.2.3