]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Print irrelevent entries in cookie dump more nicely 16651/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 16 Dec 2025 11:49:55 +0000 (12:49 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 16 Dec 2025 11:51:47 +0000 (12:51 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/rec-cookiestore.cc

index 8b660496bf1695694cf264e1e7b9c8c9bc965082..7477fd20d4b90f7d378d3e1b5d57ed8a94441063 100644 (file)
@@ -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<time_t>::max() ? "Forever" : timestamp(entry.d_lastused, tmp));
   }