diff options
| author | 2010-02-23 12:44:26 -0600 | |
|---|---|---|
| committer | 2010-08-03 17:32:37 -0400 | |
| commit | f222755ccfd04c29bd098355cc1d6fab43f1b593 (patch) | |
| tree | 88c5708c07d1f9a4dbbf2236adb4ffc39ba89cb8 /src/configreader.cpp | |
| parent | Fix uninit variable warning (diff) | |
Replace #define IPV6 with <config defaultbind="ipv6">, and autodetect if not specified
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
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) { |
