From: Otto Moerbeek Date: Thu, 9 Jul 2026 12:21:17 +0000 (+0200) Subject: Add logging X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec030d6799cd6c33d9867a2ff7a840cd01c4818e;p=thirdparty%2Fpdns.git Add logging Signed-off-by: Otto Moerbeek --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index b385081d91..ad2dc48269 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -1,4 +1,4 @@ -sJSON11_LIBS = $(top_builddir)/ext/json11/libjson11.la +JSON11_LIBS = $(top_builddir)/ext/json11/libjson11.la ARC4RANDOM_LIBS = $(top_builddir)/ext/arc4random/libarc4random.la AM_CPPFLAGS += \ diff --git a/pdns/query-local-address.cc b/pdns/query-local-address.cc index dbbcdf27e5..f5b5a4d3b6 100644 --- a/pdns/query-local-address.cc +++ b/pdns/query-local-address.cc @@ -25,6 +25,8 @@ #include "query-local-address.hh" #include "iputils.hh" #include "dns_random.hh" +#include "logging.hh" +#include "logger.hh" namespace pdns { @@ -92,7 +94,12 @@ namespace pdns } addr = parts.at(0); if (parts.size() >= 2) { - itf = Interface{ parts.at(1), if_nametoindex(parts.at(1).data())}; + auto idx = if_nametoindex(parts.at(1).data()); + if (idx == 0) { + SLOG(g_log << Logger::Error << "Interface name " << parts.at(1) << " is unknown" << endl, + g_slog->withName("runtime")->info(Logr::Error, "interface unknown", "name", Logging::Loggable(parts.at(1)))); + } + itf = Interface{ parts.at(1), idx }; } AddressAndInterface tmp{ComboAddress{addr}, itf};