return true;
}
+bool readFileIfThere(const char* fname, std::string* line)
+{
+ line->clear();
+ FILE* fp = fopen(fname, "r");
+ if(!fp)
+ return false;
+ stringfgets(fp, *line);
+ fclose(fp);
+ return true;
+}
+
Regex::Regex(const string &expr)
{
if(regcomp(&d_preg, expr.c_str(), REG_ICASE|REG_NOSUB|REG_EXTENDED))
/*
PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2003 - 2013 PowerDNS.COM BV
+ Copyright (C) 2003 - 2014 PowerDNS.COM BV
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
throw PDNSException("Making a UDP server socket for resolver: "+netstringerror());
}
- setSocketReceiveBuffer(fd, 200000);
+ setSocketReceiveBuffer(fd, 250000);
sin.sin4.sin_port = htons(st.port);
int socklen=sin.sin4.sin_family==AF_INET ? sizeof(sin.sin4) : sizeof(sin.sin6);
return broadcastAccFunction<string>(boost::bind(pleaseUseNewTraceRegex, begin!=end ? *begin : ""));
}
+static void checkLinuxIPv6Limits()
+{
+#ifdef __linux__
+ string line;
+ if(readFileIfThere("/proc/sys/net/ipv6/route/max_size", &line)) {
+ int lim=atoi(line.c_str());
+ if(lim < 16384) {
+ L<<Logger::Error<<"If using IPv6, please raise sysctl net.ipv6.route.max_size, currently set to "<<lim<<", which is too low"<<endl;
+ }
+ }
+#endif
+}
+
+static void warnAboutFDS()
+{
+#if 0
+ unsigned int maxFDs, curFDs;
+ getFDLimits(curFDs, maxFDs);
+ if(curFDs < 2048)
+ L<<Logger::Warning<<"Only "<<curFDs<<" file descriptors available (out of: "<<maxFDs<<"), may not be suitable for high performance"<<endl;
+#endif
+}
void* recursorThread(void*);
int serviceMain(int argc, char*argv[])
{
-
-
L.setName(s_programname);
L.setLoglevel((Logger::Urgency)(6)); // info and up
}
showProductVersion();
-
- #if 0
- unsigned int maxFDs, curFDs;
- getFDLimits(curFDs, maxFDs);
- if(curFDs < 2048)
- L<<Logger::Warning<<"Only "<<curFDs<<" file descriptors available (out of: "<<maxFDs<<"), may not be suitable for high performance"<<endl;
- #endif
-
+ warnAboutFDS();
+
seedRandom(::arg()["entropy-source"]);
parseACLs();
g_quiet=false;
}
-
+ checkLinuxIPv6Limits();
try {
vector<string> addrs;
if(!::arg()["query-local-address6"].empty()) {