From f222755ccfd04c29bd098355cc1d6fab43f1b593 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Tue, 23 Feb 2010 12:44:26 -0600 Subject: Replace #define IPV6 with , and autodetect if not specified --- src/configreader.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 0237bd622..eca203a6c 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -22,7 +22,7 @@ ServerConfig::ServerConfig() { WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0; NoUserDns = OperSpyWhois = HideBans = HideSplits = UndernetMsgPrefix = NameOnlyModes = false; - CycleHosts = InvBypassModes = true; + WildcardIPv6 = CycleHosts = InvBypassModes = true; dns_timeout = 5; MaxTargets = 20; NetBufferSize = 10240; @@ -526,6 +526,24 @@ void ServerConfig::Fill() if (!sid.empty() && !ServerInstance->IsSID(sid)) throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter."); + std::string defbind = options->getString("defaultbind"); + if (assign(defbind) == "ipv4") + { + WildcardIPv6 = false; + } + else if (assign(defbind) == "ipv6") + { + WildcardIPv6 = true; + } + else + { + WildcardIPv6 = true; + int socktest = socket(AF_INET6, SOCK_STREAM, 0); + if (socktest < 0) + WildcardIPv6 = false; + else + close(socktest); + } ConfigTagList tags = ConfTags("uline"); for(ConfigIter i = tags.first; i != tags.second; ++i) { -- cgit v1.3.1-10-gc9f91