From 2820565ea35791a45b0f897b3c15e9c4527d6d67 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 4 Aug 2006 15:16:37 +0000 Subject: Fixes for ::0 ip's, disable autobind when using ::ffff: etc git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4703 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index f738835a8..17268dc78 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -215,14 +215,17 @@ bool InspSocket::DoConnect() return false; } - if (!this->BindAddr()) - return false; + if ((strstr(this->IP,"::ffff:") != (char*)&this->IP) && (strstr(this->IP,"::FFFF:") != (char*)&this->IP)) + { + if (!this->BindAddr()) + return false; + } log(DEBUG,"Part 2 DoConnect() %s",this->IP); insp_aton(this->IP,&addy); #ifdef IPV6 addr.sin6_family = AF_FAMILY; - memcpy(&addy, &addr.sin6_addr, sizeof(insp_inaddr)); + memcpy(&addr.sin6_addr, &addy, sizeof(insp_inaddr)); addr.sin6_port = htons(this->port); #else addr.sin_family = AF_FAMILY; -- cgit v1.2.3