fix random breakage
This commit is contained in:
parent
4614e7e0c6
commit
44bde39dbc
@ -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)
|
||||||
|
@ -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"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user