From 6d6c83f1d09706c674312bce2a66b011cb07c206 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 20 Aug 2007 18:03:21 +0000 Subject: Backport, phew, glad this one applied cleanly. The only possibility for the issue sts found is that a socket is deleted but also ends up in the socket cull list somehow. To ensure that the socket does not get deleted, remove the delete and replace with an explicit call to insert into the socket cull list. We were grappling with these issues in early 1.1 with the userrec cull list, too. NOTE for later 1.2's consider making CullList a base class which we can derive from to delete lists of other items than userrecs. git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@7776 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index edb58a05c..9676a4f15 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -186,7 +186,7 @@ bool InspSocket::BindAddr(const std::string &ip) in6_addr n; if (inet_pton(AF_INET6, IP.c_str(), &n) > 0) { - memcpy(&((sockaddr_in6*)s)->sin6_addr, &n, sizeof(n)); + memcpy(&((sockaddr_in6*)s)->sin6_addr, &n, sizeof(sockaddr_in6)); ((sockaddr_in6*)s)->sin6_port = 0; ((sockaddr_in6*)s)->sin6_family = AF_INET6; size = sizeof(sockaddr_in6); @@ -284,7 +284,7 @@ bool InspSocket::DoConnect() if (inet_pton(AF_INET6, this->host, &addy) > 0) { ((sockaddr_in6*)addr)->sin6_family = AF_INET6; - memcpy(&((sockaddr_in6*)addr)->sin6_addr, &addy, sizeof(addy)); + memcpy(&((sockaddr_in6*)addr)->sin6_addr, &addy, sizeof(sockaddr_in6)); ((sockaddr_in6*)addr)->sin6_port = htons(this->port); size = sizeof(sockaddr_in6); } -- cgit v1.3.1-10-gc9f91