- if (strncasecmp(Addr.c_str(), "::ffff:", 7) == 0)
- this->Logs->Log("SOCKET", LOG_DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead.");
+ // Are we creating a TCP/IP listener?
+ const std::string address = tag->getString("address");
+ const std::string portlist = tag->getString("port");
+ if (!address.empty() || !portlist.empty())
+ {
+ // InspIRCd supports IPv4 and IPv6 natively; no 4in6 required.
+ if (strncasecmp(address.c_str(), "::ffff:", 7) == 0)
+ this->Logs->Log("SOCKET", LOG_DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead.");
+
+ // A TCP listener with no ports is not very useful.
+ if (portlist.empty())
+ this->Logs->Log("SOCKET", LOG_DEFAULT, "TCP listener on %s at %s has no ports specified!",
+ address.empty() ? "*" : address.c_str(), tag->getTagLocation().c_str());
+
+ irc::portparser portrange(portlist, false);
+ for (int port; (port = portrange.GetToken()); )
+ {
+ irc::sockets::sockaddrs bindspec;
+ if (!irc::sockets::aptosa(address, port, bindspec))
+ continue;