]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add logging 17708/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 9 Jul 2026 12:21:17 +0000 (14:21 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 9 Jul 2026 13:11:45 +0000 (15:11 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/Makefile.am
pdns/query-local-address.cc

index b385081d91811a8d531ce8864754ae7c5892ebdc..ad2dc48269af520cda21f28f1dcf0f182700a052 100644 (file)
@@ -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 += \
index dbbcdf27e5e96a96caa8368e50b374a03bb25f0a..f5b5a4d3b61da692c245e9bdb7580ea9e2eb7570 100644 (file)
@@ -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};