aboutsummaryrefslogtreecommitdiffstats
path: root/src/inspsocket.cpp
diff options
context:
space:
mode:
authorGravatar brain2007-08-20 18:35:54 +0000
committerGravatar brain2007-08-20 18:35:54 +0000
commit1c62ae29b02d134c8b4debf0e0c4c8ad04729d7f (patch)
treee0922d1f69b90ea7288705ddcc9bc230b2835e4a /src/inspsocket.cpp
parentbackport fix for bug i just introduced (oops) (diff)
Merge comments back into stable, so that people can still understand stable!
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@7780 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r--src/inspsocket.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index a5ea2f056..e372a4472 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -179,6 +179,7 @@ bool InspSocket::BindAddr(const std::string &ip)
{
if (!ip.empty() || ((IP != "*") && (IP != "127.0.0.1") && (!IP.empty()) && (IP != "::1")))
{
+ /* The [2] is required because we may write a sockaddr_in6 here, and sockaddr_in6 is larger than sockaddr, where sockaddr_in4 is not. */
sockaddr* s = new sockaddr[2];
#ifdef IPV6
if (v6)
@@ -236,6 +237,7 @@ bool InspSocket::BindAddr(const std::string &ip)
bool InspSocket::DoConnect()
{
+ /* The [2] is required because we may write a sockaddr_in6 here, and sockaddr_in6 is larger than sockaddr, where sockaddr_in4 is not. */
sockaddr* addr = new sockaddr[2];
socklen_t size = sizeof(sockaddr_in);
#ifdef IPV6
@@ -603,6 +605,7 @@ bool InspSocket::Poll()
break;
case I_LISTENING:
{
+ /* The [2] is required because we may write a sockaddr_in6 here, and sockaddr_in6 is larger than sockaddr, where sockaddr_in4 is not. */
sockaddr* client = new sockaddr[2];
length = sizeof (sockaddr_in);
std::string recvip;