mirror of
https://github.com/inspircd/inspircd.git
synced 2025-04-21 07:21:27 -04:00
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
This commit is contained in:
parent
c61b20a310
commit
c4953ea1f5
@ -166,14 +166,13 @@ void InspSocket::SetQueues(int nfd)
|
|||||||
*/
|
*/
|
||||||
bool InspSocket::BindAddr(const std::string &ip)
|
bool InspSocket::BindAddr(const std::string &ip)
|
||||||
{
|
{
|
||||||
Instance->Log(DEBUG,"BindAddr(%s)", ip.c_str());
|
|
||||||
ConfigReader Conf(this->Instance);
|
ConfigReader Conf(this->Instance);
|
||||||
bool bindfail = false;
|
bool bindfail = false;
|
||||||
socklen_t size = sizeof(sockaddr_in);
|
socklen_t size = sizeof(sockaddr_in);
|
||||||
#ifdef IPV6
|
#ifdef IPV6
|
||||||
bool v6 = false;
|
bool v6 = false;
|
||||||
/* Are we looking for a binding to fit an ipv6 host? */
|
/* 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;
|
v6 = true;
|
||||||
#endif
|
#endif
|
||||||
int j = 0;
|
int j = 0;
|
||||||
@ -196,7 +195,11 @@ bool InspSocket::BindAddr(const std::string &ip)
|
|||||||
size = sizeof(sockaddr_in6);
|
size = sizeof(sockaddr_in6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bindfail = true;
|
{
|
||||||
|
delete[] s;
|
||||||
|
j++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -207,7 +210,11 @@ bool InspSocket::BindAddr(const std::string &ip)
|
|||||||
((sockaddr_in*)s)->sin_family = AF_INET;
|
((sockaddr_in*)s)->sin_family = AF_INET;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bindfail = true;
|
{
|
||||||
|
delete[] s;
|
||||||
|
j++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
in_addr n;
|
in_addr n;
|
||||||
@ -217,13 +224,12 @@ bool InspSocket::BindAddr(const std::string &ip)
|
|||||||
((sockaddr_in*)s)->sin_family = AF_INET;
|
((sockaddr_in*)s)->sin_family = AF_INET;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bindfail = true;
|
|
||||||
#endif
|
|
||||||
if (bindfail)
|
|
||||||
{
|
{
|
||||||
delete[] s;
|
delete[] s;
|
||||||
return false;
|
j++;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (bind(this->fd, s, size) < 0)
|
if (bind(this->fd, s, size) < 0)
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,6 @@ class RFC1413 : public InspSocket
|
|||||||
#endif
|
#endif
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
Instance->Log(DEBUG,"BUG: Ident: failed to get socket names");
|
|
||||||
delete[] sock_us;
|
delete[] sock_us;
|
||||||
delete[] sock_them;
|
delete[] sock_them;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user