this->fd = newfd;
this->state = I_CONNECTED;
strlcpy(this->IP,ip,MAXBUF);
this->fd = newfd;
this->state = I_CONNECTED;
strlcpy(this->IP,ip,MAXBUF);
-InspSocket::InspSocket(InspIRCd* SI, const std::string &ipaddr, int aport, bool listening, unsigned long maxtime)
+InspSocket::InspSocket(InspIRCd* SI, const std::string &ipaddr, int aport, bool listening, unsigned long maxtime, const std::string &connectbindip)
this->fd = -1;
this->Instance = SI;
strlcpy(host,ipaddr.c_str(),MAXBUF);
this->WaitingForWriteEvent = false;
this->IsIOHooked = false;
this->fd = -1;
this->Instance = SI;
strlcpy(host,ipaddr.c_str(),MAXBUF);
this->WaitingForWriteEvent = false;
this->IsIOHooked = false;
- std::string Type = Conf.ReadValue("bind","type",j);
- std::string IP = Conf.ReadValue("bind","address",j);
- if (Type == "servers")
+ std::string IP = ip.empty() ? Conf.ReadValue("bind","address",j) : ip;
+ if (!ip.empty() || Conf.ReadValue("bind","type",j) == "servers")
- memcpy(((sockaddr_in6*)s)->sin6_addr, &n, sizeof(n));
- s.sin6_family = AF_INET6;
+ memcpy(&((sockaddr_in6*)s)->sin6_addr, &n, sizeof(n));
+ ((sockaddr_in6*)s)->sin6_family = AF_INET6;
this->fd = socket(AF_INET6, SOCK_STREAM, 0);
if ((this->fd > -1) && ((strstr(this->IP,"::ffff:") != (char*)&this->IP) && (strstr(this->IP,"::FFFF:") != (char*)&this->IP)))
{
this->fd = socket(AF_INET6, SOCK_STREAM, 0);
if ((this->fd > -1) && ((strstr(this->IP,"::ffff:") != (char*)&this->IP) && (strstr(this->IP,"::FFFF:") != (char*)&this->IP)))
{
length = sizeof(sockaddr_in6);
#endif
incoming = accept (this->fd, client, &length);
length = sizeof(sockaddr_in6);
#endif
incoming = accept (this->fd, client, &length);
- recvip = inet_ntop(AF_INET6, ((sockaddr_in6*)client)->sin6_addr, buf, sizeof(buf));
+ recvip = inet_ntop(AF_INET6, &((sockaddr_in6*)client)->sin6_addr, buf, sizeof(buf));