diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-30 23:56:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-30 23:56:20 +0000 |
commit | 21b5d0d5bd1e7d7de5bf34e9a1fc950fe9e1d6ec (patch) | |
tree | b56595f4842aab11929e4810bb22d640674e8b55 | |
parent | 610a2edba049eaede5e0ccaed4c10a0b23e16e6c (diff) |
Tweaks to backwards memcpy's that dont actually do anything, causing ipv6 address bindings to potentially be bound to random ips.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6467 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/inspsocket.cpp | 2 | ||||
-rw-r--r-- | src/socket.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index f408de6dd..678583ed0 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -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; diff --git a/src/socket.cpp b/src/socket.cpp index 472d58c2e..861cd9b12 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -294,7 +294,7 @@ bool InspIRCd::BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server *addr = 0; if ((*addr) && (insp_aton(addr,&addy) < 1)) - return false;; + return false; #ifdef IPV6 server.sin6_family = AF_FAMILY; @@ -304,7 +304,7 @@ bool InspIRCd::BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server if (!*addr) { #ifdef IPV6 - memcpy(&addy, &server.sin6_addr, sizeof(in6_addr)); + memcpy(&server.sin6_addr, INADDR6_ANY, sizeof(INADDR6_ANY)); #else server.sin_addr.s_addr = htonl(INADDR_ANY); #endif @@ -312,7 +312,7 @@ bool InspIRCd::BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server else { #ifdef IPV6 - memcpy(&addy, &server.sin6_addr, sizeof(in6_addr)); + memcpy(&server.sin6_addr, &addy, sizeof(in6_addr)); #else server.sin_addr = addy; #endif |