From: Peter van Dijk Date: Thu, 12 Sep 2024 16:58:32 +0000 (+0200) Subject: sdig: print ID if we did not generate it X-Git-Tag: rec-5.2.0-alpha1~34^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74a4275c206c7e8b9fd23fd2ca07a78e0fd3bd73;p=thirdparty%2Fpdns.git sdig: print ID if we did not generate it --- diff --git a/pdns/sdig.cc b/pdns/sdig.cc index c6441debe6..d4cf2cace6 100644 --- a/pdns/sdig.cc +++ b/pdns/sdig.cc @@ -86,16 +86,23 @@ static void fillPacket(vector& packet, const string& q, const string& t pw.getHeader()->id = htons(qid); } -static void printReply(const string& reply, bool showflags, bool hidesoadetails, bool dumpluaraw) +static void printReply(const string& reply, bool showflags, bool hidesoadetails, bool dumpluaraw, bool ignoreId = false) { MOADNSParser mdp(false, reply); - if (!s_expectedIDs.count(ntohs(mdp.d_header.id))) { + if (!ignoreId && !s_expectedIDs.count(ntohs(mdp.d_header.id))) { cout << "ID " << ntohs(mdp.d_header.id) << " was not expected, this response was not meant for us!"< tlsCtx{nullptr}; if (dot) {