diff options
| author | 2007-03-23 20:14:43 +0000 | |
|---|---|---|
| committer | 2007-03-23 20:14:43 +0000 | |
| commit | c4953ea1f51fc72083f3eacc3d13bee2713d244b (patch) | |
| tree | 7abec07060784373ab97c294d26f2d042561777e /src/inspsocket.cpp | |
| parent | Tweak some stuff about (diff) | |
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
Diffstat (limited to 'src/inspsocket.cpp')
| -rw-r--r-- | src/inspsocket.cpp | 22 |
1 files changed, 14 insertions, 8 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) { |
