]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Tweaks to backwards memcpy's that dont actually do anything, causing ipv6 address...
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index 18fd346b7259130fcb14ece569413d711fa2764e..678583ed0c3b6025c8d7bc67afabc4df79d1461d 100644 (file)
@@ -146,7 +146,7 @@ bool InspSocket::BindAddr()
                std::string IP = Conf.ReadValue("bind","address",j);
                if (Type == "servers")
                {
-                       if ((IP != "*") && (IP != "127.0.0.1") && (IP != ""))
+                       if ((IP != "*") && (IP != "127.0.0.1") && (IP != "") && (IP != "::1"))
                        {
                                insp_sockaddr s;
 
@@ -235,6 +235,11 @@ bool InspSocket::DoConnect()
 
 void InspSocket::Close()
 {
+       /* Save this, so we dont lose it,
+        * otherise on failure, error messages
+        * might be inaccurate.
+        */
+       int save = errno;
        if (this->fd > -1)
        {
                 if (this->IsIOHooked && Instance->Config->GetIOHook(this))
@@ -252,6 +257,7 @@ void InspSocket::Close()
                shutdown(this->fd,2);
                close(this->fd);
        }
+       errno = save;
 }
 
 std::string InspSocket::GetIP()