From 44bde39dbc54d0f3d538c0e0beb86929e60bb59e Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 17 Apr 2018 17:10:32 +0200 Subject: [PATCH] fix random breakage --- tdns/dnsmessages.cc | 4 +--- tdns/tdig.cc | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tdns/dnsmessages.cc b/tdns/dnsmessages.cc index 9dfac3d..7d33779 100644 --- a/tdns/dnsmessages.cc +++ b/tdns/dnsmessages.cc @@ -1,6 +1,5 @@ #include "dnsmessages.hh" #include "record-types.hh" -#include using namespace std; DNSMessageReader::DNSMessageReader(const char* in, uint16_t size) @@ -111,8 +110,7 @@ DNSMessageWriter::~DNSMessageWriter() = default; void DNSMessageWriter::randomizeID() { - if(getrandom(&dh.id, 2, 0) != 2) - throw std::runtime_error("No entropy"); + dh.id = random(); } void DNSMessageWriter::xfrName(const DNSName& name, bool compress) diff --git a/tdns/tdig.cc b/tdns/tdig.cc index f5749f1..17e4349 100644 --- a/tdns/tdig.cc +++ b/tdns/tdig.cc @@ -5,7 +5,6 @@ #include "sclasses.hh" #include #include -#include #include "record-types.hh" /*!