fix random breakage

This commit is contained in:
bert hubert 2018-04-17 17:10:32 +02:00
parent 4614e7e0c6
commit 44bde39dbc
2 changed files with 1 additions and 4 deletions

View File

@ -1,6 +1,5 @@
#include "dnsmessages.hh" #include "dnsmessages.hh"
#include "record-types.hh" #include "record-types.hh"
#include <sys/random.h>
using namespace std; using namespace std;
DNSMessageReader::DNSMessageReader(const char* in, uint16_t size) DNSMessageReader::DNSMessageReader(const char* in, uint16_t size)
@ -111,8 +110,7 @@ DNSMessageWriter::~DNSMessageWriter() = default;
void DNSMessageWriter::randomizeID() void DNSMessageWriter::randomizeID()
{ {
if(getrandom(&dh.id, 2, 0) != 2) dh.id = random();
throw std::runtime_error("No entropy");
} }
void DNSMessageWriter::xfrName(const DNSName& name, bool compress) void DNSMessageWriter::xfrName(const DNSName& name, bool compress)

View File

@ -5,7 +5,6 @@
#include "sclasses.hh" #include "sclasses.hh"
#include <thread> #include <thread>
#include <signal.h> #include <signal.h>
#include <sys/random.h>
#include "record-types.hh" #include "record-types.hh"
/*! /*!