]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Don't try quite so hard to writev() the entire buffer in one go
[user/henk/code/inspircd.git] / src / configreader.cpp
index 9db1f2665499d4828026f50305321c7cbbbd4606..1905b36d083412fb62e67c06550fe10f0c24a51e 100644 (file)
  * ---------------------------------------------------
  */
 
-/* $Core */
-/* $CopyInstall: conf/inspircd.quotes.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.rules.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.motd.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.helpop-full.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.helpop.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.censor.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.filter.example $(CONPATH) */
-/* $CopyInstall: conf/inspircd.conf.example $(CONPATH) */
-/* $CopyInstall: conf/modules.conf.example $(CONPATH) */
-/* $CopyInstall: conf/opers.conf.example $(CONPATH) */
-/* $CopyInstall: conf/links.conf.example $(CONPATH) */
-/* $CopyInstall: tools/gdbargs $(BASE)/.gdbargs */
-
 #include "inspircd.h"
 #include <fstream>
 #include "xline.h"
@@ -36,7 +22,7 @@ ServerConfig::ServerConfig()
 {
        WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0;
        NoUserDns = OperSpyWhois = HideBans = HideSplits = UndernetMsgPrefix = false;
-       CycleHosts = InvBypassModes = true;
+       WildcardIPv6 = CycleHosts = InvBypassModes = true;
        dns_timeout = 5;
        MaxTargets = 20;
        NetBufferSize = 10240;
@@ -465,7 +451,7 @@ void ServerConfig::Fill()
        DisabledCommands = ConfValue("disabled")->getString("commands", "");
        DisabledDontExist = ConfValue("disabled")->getBool("fakenonexistant");
        UserStats = security->getString("userstats");
-       CustomVersion = security->getString("customversion");
+       CustomVersion = security->getString("customversion", Network + " IRCd");
        HideSplits = security->getBool("hidesplits");
        HideBans = security->getBool("hidebans");
        HideWhoisServer = security->getString("hidewhois");
@@ -484,7 +470,6 @@ void ServerConfig::Fill()
        WhoWasGroupSize = ConfValue("whowas")->getInt("groupsize");
        WhoWasMaxGroups = ConfValue("whowas")->getInt("maxgroups");
        WhoWasMaxKeep = ServerInstance->Duration(ConfValue("whowas")->getString("maxkeep"));
-       DieValue = ConfValue("die")->getString("value");
        MaxChans = ConfValue("channels")->getInt("users", 20);
        OperMaxChans = ConfValue("channels")->getInt("opers", 60);
        c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32);
@@ -513,6 +498,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)
        {