From c4953ea1f51fc72083f3eacc3d13bee2713d244b Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 23 Mar 2007 20:14:43 +0000 Subject: [PATCH] ident over ipv6 fixes, and fixes to inspsocket BindAddr which wasnt doing ipv6 outbound connects properly. You'll need to restart to apply this one, dmb git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6702 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 22 ++++++++++++++-------- src/modules/m_ident.cpp | 1 - 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 72b210134..ce4141eaa 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -166,14 +166,13 @@ void InspSocket::SetQueues(int nfd) */ bool InspSocket::BindAddr(const std::string &ip) { - Instance->Log(DEBUG,"BindAddr(%s)", ip.c_str()); ConfigReader Conf(this->Instance); bool bindfail = false; socklen_t size = sizeof(sockaddr_in); #ifdef IPV6 bool v6 = false; /* Are we looking for a binding to fit an ipv6 host? */ - if ((!*this->host) || strchr(this->host, ':')) + if ((ip.empty()) || (ip.find(':') != std::string::npos)) v6 = true; #endif int j = 0; @@ -196,7 +195,11 @@ bool InspSocket::BindAddr(const std::string &ip) size = sizeof(sockaddr_in6); } else - bindfail = true; + { + delete[] s; + j++; + continue; + } } else { @@ -207,7 +210,11 @@ bool InspSocket::BindAddr(const std::string &ip) ((sockaddr_in*)s)->sin_family = AF_INET; } else - bindfail = true; + { + delete[] s; + j++; + continue; + } } #else in_addr n; @@ -217,13 +224,12 @@ bool InspSocket::BindAddr(const std::string &ip) ((sockaddr_in*)s)->sin_family = AF_INET; } else - bindfail = true; -#endif - if (bindfail) { delete[] s; - return false; + j++; + continue; } +#endif if (bind(this->fd, s, size) < 0) { diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 25d7d4414..ac62616a6 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -159,7 +159,6 @@ class RFC1413 : public InspSocket #endif if (success) { - Instance->Log(DEBUG,"BUG: Ident: failed to get socket names"); delete[] sock_us; delete[] sock_them; return false; -- 2.39.2