]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Move checking for +ikl from the core to to core_channel.
[user/henk/code/inspircd.git] / src / socket.cpp
index 0ba57a81009c3810745609a305a850f31dd85e2c..6133d9ee4d2d435966c35af8f8d7b26c31d0990b 100644 (file)
@@ -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<ListenSocket*>::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, 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
@@ -179,7 +178,7 @@ std::string irc::sockets::sockaddrs::str() const
        return "<unknown>";
 }
 
-int irc::sockets::sockaddrs::sa_size() const
+socklen_t irc::sockets::sockaddrs::sa_size() const
 {
        if (sa.sa_family == AF_INET)
                return sizeof(in4);
@@ -199,7 +198,7 @@ bool irc::sockets::sockaddrs::operator==(const irc::sockets::sockaddrs& other) c
        return !memcmp(this, &other, sizeof(*this));
 }
 
-static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs& sa, int range)
+static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs& sa, unsigned char range)
 {
        const unsigned char* base;
        unsigned char target_byte;
@@ -240,7 +239,7 @@ static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs
        }
 }
 
-irc::sockets::cidr_mask::cidr_mask(const irc::sockets::sockaddrs& sa, int range)
+irc::sockets::cidr_mask::cidr_mask(const irc::sockets::sockaddrs& sa, unsigned char range)
 {
        sa2cidr(*this, sa, range);
 }
@@ -268,7 +267,7 @@ std::string irc::sockets::cidr_mask::str() const
        irc::sockets::sockaddrs sa;
        sa.sa.sa_family = type;
        unsigned char* base;
-       int len;
+       size_t len;
        if (type == AF_INET)
        {
                base = (unsigned char*)&sa.in4.sin_addr;