From d0983bfff33b1c6fbdcced8bc766c8774f73bd13 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 4 Apr 2018 12:42:29 +0200 Subject: [PATCH] Fix review comments --- pdns/dnswriter.cc | 2 +- pdns/pdns_recursor.cc | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index 4f7656f600..d788217e8c 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -110,7 +110,7 @@ void DNSPacketWriter::addOpt(uint16_t udpsize, int extRCode, int Z, const vector * indicates that an unextended RCODE is in use (values 0 through 15). */ stuff.extRCode = extRCode>>4; - if (extRCode > 15) { // As this trumps the existing RCODE + if (extRCode != 0) { // As this trumps the existing RCODE getHeader()->rcode = extRCode; } diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index beaccd2f9e..eb481d2f79 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -3195,6 +3195,11 @@ static int serviceMain(int argc, char*argv[]) g_quiet=false; g_dnssecLOG=true; } + char myHostname[MAXHOSTNAMELEN]; + if (gethostname(myHostname, sizeof(myHostname)-1) == 0){ + } else { + g_log<