]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Fix FIDENT response forging to run prior to the ENCAP strip
[user/henk/code/inspircd.git] / src / socket.cpp
index 0f2fbea221a6951eeb53a89f1c754d609baa0193..63b373ccee362ef2f5e8b74cdaeca68f735bb512 100644 (file)
@@ -86,8 +86,9 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
                while (0 != (portno = portrange.GetToken()))
                {
                        irc::sockets::sockaddrs bindspec;
-                       irc::sockets::aptosa(Addr, portno, bindspec);
-                       std::string bind_readable = irc::sockets::satouser(bindspec);
+                       if (!irc::sockets::aptosa(Addr, portno, bindspec))
+                               continue;
+                       std::string bind_readable = bindspec.str();
 
                        bool skip = false;
                        for (std::vector<ListenSocket*>::iterator n = old_ports.begin(); n != old_ports.end(); ++n)
@@ -101,7 +102,8 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
                        }
                        if (!skip)
                        {
-                               ListenSocket *ll = new ListenSocket(tag, Addr, portno);
+                               ListenSocket* ll = new ListenSocket(tag, bindspec);
+
                                if (ll->GetFd() > -1)
                                {
                                        bound++;
@@ -329,7 +331,7 @@ std::string irc::sockets::cidr_mask::str() const
        else
                return "";
        memcpy(base, bits, len);
-       return sa.addr() + "/" + ConvToStr(length);
+       return sa.addr() + "/" + ConvToStr((int)length);
 }
 
 bool irc::sockets::cidr_mask::operator==(const cidr_mask& other) const