diff options
-rw-r--r-- | src/inspsocket.cpp | 22 | ||||
-rw-r--r-- | 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; |