-/* Most irc servers require you to specify the ip you want to bind to.
- * If you dont specify an IP, they rather dumbly bind to the first IP
- * of the box (e.g. INADDR_ANY). In InspIRCd, we scan thought the IP
- * addresses we've bound server ports to, and we try and bind our outbound
- * connections to the first usable non-loopback and non-any IP we find.
- * This is easier to configure when you have a lot of links and a lot
- * of servers to configure.
- */
-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, ':'))
- v6 = true;
-#endif
- int j = 0;
- while (j < Conf.Enumerate("bind") || (!ip.empty()))