#include "recpacketcache.hh"
#include "utility.hh"
#include "dns_random.hh"
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+#endif
#include "opensslsigners.hh"
#include <iostream>
#include <errno.h>
// DO NOT MOVE THIS CODE UP - DNSPacketWriter needs to get the original-cased version
if (g_lowercaseOutgoing)
- dc->d_mdp.d_qname = DNSName(toLower(dc->d_mdp.d_qname.toString()));
+ dc->d_mdp.d_qname = dc->d_mdp.d_qname.makeLowerCase();
uint32_t minTTL=std::numeric_limits<uint32_t>::max();
struct timeval tv={0,0};
HarvestTimestamp(&msgh, &tv);
ComboAddress dest;
- memset(&dest, 0, sizeof(dest)); // this makes sure we igore this address if not returned by recvmsg above
+ memset(&dest, 0, sizeof(dest)); // this makes sure we ignore this address if not returned by recvmsg above
auto loc = rplookup(g_listenSocketsAddresses, fd);
if(HarvestDestinationAddress(&msgh, &dest)) {
// but.. need to get port too
g_maxMThreads = ::arg().asNum("max-mthreads");
checkOrFixFDS();
+#ifdef HAVE_LIBSODIUM
+ if (sodium_init() == -1) {
+ L<<Logger::Error<<"Unable to initialize sodium crypto library"<<endl;
+ exit(99);
+ }
+#endif
+
openssl_thread_setup();
openssl_seed();
::arg().set("chroot","switch to chroot jail")="";
::arg().set("setgid","If set, change group id to this gid for more security")="";
::arg().set("setuid","If set, change user id to this uid for more security")="";
- ::arg().set("network-timeout", "Wait this nummer of milliseconds for network i/o")="1500";
+ ::arg().set("network-timeout", "Wait this number of milliseconds for network i/o")="1500";
::arg().set("threads", "Launch this number of threads")="2";
::arg().set("processes", "Launch this number of processes (EXPERIMENTAL, DO NOT CHANGE)")="1"; // if we un-experimental this, need to fix openssl rand seeding for multiple PIDs!
::arg().set("config-name","Name of this virtual configuration - will rename the binary image")="";