From dfd9dbf4b6069a05343a33e9322c6e0043445d94 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 16 Dec 2025 12:49:55 +0100 Subject: [PATCH] rec: Print irrelevent entries in cookie dump more nicely Signed-off-by: Otto Moerbeek --- pdns/recursordist/rec-cookiestore.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdns/recursordist/rec-cookiestore.cc b/pdns/recursordist/rec-cookiestore.cc index 8b660496bf..7477fd20d4 100644 --- a/pdns/recursordist/rec-cookiestore.cc +++ b/pdns/recursordist/rec-cookiestore.cc @@ -47,8 +47,9 @@ uint64_t CookieStore::dump(int fileDesc) const count++; timebuf_t tmp; fprintf(filePtr.get(), "%s\t%s\t%s\t%s\t%s\n", - entry.d_address.toStringWithPortExcept(53).c_str(), entry.d_localaddress.toString().c_str(), - entry.d_cookie.toDisplayString().c_str(), + entry.d_address.toStringWithPortExcept(53).c_str(), + entry.d_localaddress.isUnspecified() ? "-" : entry.d_localaddress.toString().c_str(), + entry.d_support == CookieEntry::Support::Unsupported ? "-" : entry.d_cookie.toDisplayString().c_str(), CookieEntry::toString(entry.d_support).c_str(), entry.d_lastused == std::numeric_limits::max() ? "Forever" : timestamp(entry.d_lastused, tmp)); } -- 2.47.3