Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package dnsdist for openSUSE:Factory checked in at 2023-03-09 17:46:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dnsdist (Old) and /work/SRC/openSUSE:Factory/.dnsdist.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dnsdist" Thu Mar 9 17:46:54 2023 rev:2 rq:1070406 version:1.8.0~rc2 Changes: -------- --- /work/SRC/openSUSE:Factory/dnsdist/dnsdist.changes 2023-02-27 12:55:08.259337539 +0100 +++ /work/SRC/openSUSE:Factory/.dnsdist.new.31432/dnsdist.changes 2023-03-09 17:46:56.615292297 +0100 @@ -1,0 +2,8 @@ +Thu Mar 9 11:33:45 UTC 2023 - Adam Majer <adam.ma...@suse.de> - 1.8.0~rc2 + +- update to 1.8.0~rc2 + https://dnsdist.org/changelog.html#change-1.8.0-rc2 +- no_doh_protobuf.patch, f44a8a8f19aff191fb1dc0631e37ec30ff087c25.patch + upstreamed and removed + +------------------------------------------------------------------- Old: ---- dnsdist-1.8.0-rc1.tar.bz2 dnsdist-1.8.0-rc1.tar.bz2.sig f44a8a8f19aff191fb1dc0631e37ec30ff087c25.patch no_doh_protobuf.patch New: ---- dnsdist-1.8.0-rc2.tar.bz2 dnsdist-1.8.0-rc2.tar.bz2.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dnsdist.spec ++++++ --- /var/tmp/diff_new_pack.sFYtXf/_old 2023-03-09 17:46:58.603302879 +0100 +++ /var/tmp/diff_new_pack.sFYtXf/_new 2023-03-09 17:46:58.607302900 +0100 @@ -34,10 +34,10 @@ %bcond_with dnsdist_re2 %endif -%define file_version 1.8.0-rc1 +%define file_version 1.8.0-rc2 Name: dnsdist -Version: 1.8.0~rc1 +Version: 1.8.0~rc2 Release: 0 License: GPL-2.0 Summary: A highly DNS-, DoS- and abuse-aware loadbalancer @@ -50,8 +50,6 @@ Source11: dnsdist.lua Source12: usr.sbin.dnsdist Source13: local.usr.sbin.dnsdist -Patch1: no_doh_protobuf.patch -Patch2: f44a8a8f19aff191fb1dc0631e37ec30ff087c25.patch %if %{with apparmor} BuildRequires: apparmor-profiles %endif ++++++ dnsdist-1.8.0-rc1.tar.bz2 -> dnsdist-1.8.0-rc2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/configure new/dnsdist-1.8.0-rc2/configure --- old/dnsdist-1.8.0-rc1/configure 2023-02-22 15:04:14.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/configure 2023-03-08 11:11:39.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for dnsdist 1.8.0-rc1. +# Generated by GNU Autoconf 2.69 for dnsdist 1.8.0-rc2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='dnsdist' PACKAGE_TARNAME='dnsdist' -PACKAGE_VERSION='1.8.0-rc1' -PACKAGE_STRING='dnsdist 1.8.0-rc1' +PACKAGE_VERSION='1.8.0-rc2' +PACKAGE_STRING='dnsdist 1.8.0-rc2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1585,7 +1585,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dnsdist 1.8.0-rc1 to adapt to many kinds of systems. +\`configure' configures dnsdist 1.8.0-rc2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1656,7 +1656,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dnsdist 1.8.0-rc1:";; + short | recursive ) echo "Configuration of dnsdist 1.8.0-rc2:";; esac cat <<\_ACEOF @@ -1870,7 +1870,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dnsdist configure 1.8.0-rc1 +dnsdist configure 1.8.0-rc2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2542,7 +2542,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dnsdist $as_me 1.8.0-rc1, which was +It was created by dnsdist $as_me 1.8.0-rc2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3408,7 +3408,7 @@ # Define the identity of the package. PACKAGE='dnsdist' - VERSION='1.8.0-rc1' + VERSION='1.8.0-rc2' cat >>confdefs.h <<_ACEOF @@ -23832,9 +23832,6 @@ if test "x$enable_fortify_source" != "xno"; then : - OLD_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="-Wall -W -Werror $CXXFLAGS" - if test "x$enable_fortify_source" == "xauto"; then : enable_fortify_source=3 fi @@ -23851,7 +23848,7 @@ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -D_FORTIFY_SOURCE=3" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> + int main () { @@ -23875,7 +23872,7 @@ if test "x$gl_cv_warn_cxx__D_FORTIFY_SOURCE_3" = xyes; then : CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 $CFLAGS" - CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 $OLD_CXXFLAGS" + CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 $CXXFLAGS" else enable_fortify_source=2 @@ -23896,7 +23893,7 @@ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -D_FORTIFY_SOURCE=2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> + int main () { @@ -23920,7 +23917,7 @@ if test "x$gl_cv_warn_cxx__D_FORTIFY_SOURCE_2" = xyes; then : CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" - CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS" + CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CXXFLAGS" else enable_fortify_source=1 @@ -23941,7 +23938,7 @@ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -D_FORTIFY_SOURCE=1" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> + int main () { @@ -23965,7 +23962,7 @@ if test "x$gl_cv_warn_cxx__D_FORTIFY_SOURCE_1" = xyes; then : CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 $CFLAGS" - CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 $OLD_CXXFLAGS" + CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 $CXXFLAGS" else enable_fortify_source=no @@ -24589,10 +24586,6 @@ if test "x$enable_lto" != "xno"; then : - OLD_CXXFLAGS="$CXXFLAGS" - OLD_LDFLAGS="$LDFLAGS" - CXXFLAGS="-Wall -W -Werror $CXXFLAGS" - if test "x$enable_lto" == "xthin"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -flto=thin" >&5 @@ -24605,7 +24598,7 @@ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -flto=thin" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> + int main () { @@ -24629,8 +24622,8 @@ if test "x$gl_cv_warn_cxx__flto_thin" = xyes; then : CFLAGS="-flto=thin $CFLAGS" - CXXFLAGS="-flto=thin $OLD_CXXFLAGS" - LDFLAGS="-flto=thin $OLD_LDFLAGS" + CXXFLAGS="-flto=thin $CXXFLAGS" + LDFLAGS="-flto=thin $LDFLAGS" else enable_lto=auto @@ -24651,7 +24644,7 @@ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -flto=auto" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> + int main () { @@ -24675,8 +24668,8 @@ if test "x$gl_cv_warn_cxx__flto_auto" = xyes; then : CFLAGS="-flto=auto $CFLAGS" - CXXFLAGS="-flto=auto $OLD_CXXFLAGS" - LDFLAGS="-flto=auto $OLD_LDFLAGS" + CXXFLAGS="-flto=auto $CXXFLAGS" + LDFLAGS="-flto=auto $LDFLAGS" else enable_lto=yes @@ -24697,7 +24690,7 @@ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -flto" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> + int main () { @@ -24721,8 +24714,8 @@ if test "x$gl_cv_warn_cxx__flto" = xyes; then : CFLAGS="-flto $CFLAGS" - CXXFLAGS="-flto $OLD_CXXFLAGS" - LDFLAGS="-flto $OLD_LDFLAGS" + CXXFLAGS="-flto $CXXFLAGS" + LDFLAGS="-flto $LDFLAGS" else enable_lto=no @@ -24731,7 +24724,6 @@ fi - fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether link-time optimization is supported" >&5 @@ -25874,7 +25866,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dnsdist $as_me 1.8.0-rc1, which was +This file was extended by dnsdist $as_me 1.8.0-rc2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25940,7 +25932,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dnsdist config.status 1.8.0-rc1 +dnsdist config.status 1.8.0-rc2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/configure.ac new/dnsdist-1.8.0-rc2/configure.ac --- old/dnsdist-1.8.0-rc1/configure.ac 2023-02-22 15:04:05.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/configure.ac 2023-03-08 11:11:30.000000000 +0100 @@ -1,6 +1,6 @@ AC_PREREQ([2.69]) -AC_INIT([dnsdist], [1.8.0-rc1]) +AC_INIT([dnsdist], [1.8.0-rc2]) AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip parallel-tests 1.11 subdir-objects]) AM_SILENT_RULES([yes]) AC_CONFIG_MACRO_DIR([m4]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-idstate.hh new/dnsdist-1.8.0-rc2/dnsdist-idstate.hh --- old/dnsdist-1.8.0-rc1/dnsdist-idstate.hh 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-idstate.hh 2023-03-08 11:10:53.000000000 +0100 @@ -89,17 +89,16 @@ bool d_needRealTime; }; -/* g++ defines __SANITIZE_THREAD__ - clang++ supports the nice __has_feature(thread_sanitizer), - let's merge them */ -#if defined(__has_feature) -#if __has_feature(thread_sanitizer) -#define __SANITIZE_THREAD__ 1 -#endif -#endif - struct InternalQueryState { + struct ProtoBufData + { + std::optional<boost::uuids::uuid> uniqueId{std::nullopt}; // 17 + std::string d_deviceName; + std::string d_deviceID; + std::string d_requestorID; + }; + static void DeleterPlaceHolder(DOHUnit*) { } @@ -123,11 +122,12 @@ ComboAddress hopLocal; DNSName qname; // 24 std::string poolName; // 24 - StopWatch queryRealTime{true}; // 16 + StopWatch queryRealTime{true}; // 24 std::shared_ptr<DNSDistPacketCache> packetCache{nullptr}; // 16 std::unique_ptr<DNSCryptQuery> dnsCryptQuery{nullptr}; // 8 std::unique_ptr<QTag> qTag{nullptr}; // 8 - std::unique_ptr<PacketBuffer> d_packet; // Initial packet, so we can restart the query from the response path if needed // 8 + std::unique_ptr<PacketBuffer> d_packet{nullptr}; // Initial packet, so we can restart the query from the response path if needed // 8 + std::unique_ptr<ProtoBufData> d_protoBufData{nullptr}; boost::optional<uint32_t> tempFailureTTL{boost::none}; // 8 ClientState* cs{nullptr}; // 8 std::unique_ptr<DOHUnit, void (*)(DOHUnit*)> du; // 8 @@ -146,7 +146,6 @@ uint16_t cacheFlags{0}; // DNS flags as sent to the backend // 2 uint16_t udpPayloadSize{0}; // Max UDP payload size from the query // 2 dnsdist::Protocol protocol; // 1 - boost::optional<boost::uuids::uuid> uniqueId{boost::none}; // 17 (placed here to reduce the space lost to padding) bool ednsAdded{false}; bool ecsAdded{false}; bool skipCache{false}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-lua-actions.cc new/dnsdist-1.8.0-rc2/dnsdist-lua-actions.cc --- old/dnsdist-1.8.0-rc1/dnsdist-lua-actions.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-lua-actions.cc 2023-03-08 11:10:53.000000000 +0100 @@ -1519,8 +1519,11 @@ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override { - if (!dq->ids.uniqueId) { - dq->ids.uniqueId = getUniqueID(); + if (!dq->ids.d_protoBufData) { + dq->ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + if (!dq->ids.d_protoBufData->uniqueId) { + dq->ids.d_protoBufData->uniqueId = getUniqueID(); } DNSDistProtoBufMessage message(*dq); @@ -1660,8 +1663,11 @@ } DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override { - if (!dr->ids.uniqueId) { - dr->ids.uniqueId = getUniqueID(); + if (!dr->ids.d_protoBufData) { + dr->ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + if (!dr->ids.d_protoBufData->uniqueId) { + dr->ids.d_protoBufData->uniqueId = getUniqueID(); } DNSDistProtoBufMessage message(*dr, d_includeCNAME); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-lua-bindings-dnsquestion.cc new/dnsdist-1.8.0-rc2/dnsdist-lua-bindings-dnsquestion.cc --- old/dnsdist-1.8.0-rc1/dnsdist-lua-bindings-dnsquestion.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-lua-bindings-dnsquestion.cc 2023-03-08 11:10:53.000000000 +0100 @@ -56,6 +56,39 @@ dq.ids.tempFailureTTL = newValue; } ); + luaCtx.registerMember<std::string (DNSQuestion::*)>("deviceID", [](const DNSQuestion& dq) -> std::string { + if (dq.ids.d_protoBufData) { + return dq.ids.d_protoBufData->d_deviceID; + } + return std::string(); + }, [](DNSQuestion& dq, const std::string& newValue) { + if (!dq.ids.d_protoBufData) { + dq.ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + dq.ids.d_protoBufData->d_deviceID = newValue; + }); + luaCtx.registerMember<std::string (DNSQuestion::*)>("deviceName", [](const DNSQuestion& dq) -> std::string { + if (dq.ids.d_protoBufData) { + return dq.ids.d_protoBufData->d_deviceName; + } + return std::string(); + }, [](DNSQuestion& dq, const std::string& newValue) { + if (!dq.ids.d_protoBufData) { + dq.ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + dq.ids.d_protoBufData->d_deviceName = newValue; + }); + luaCtx.registerMember<std::string (DNSQuestion::*)>("requestorID", [](const DNSQuestion& dq) -> std::string { + if (dq.ids.d_protoBufData) { + return dq.ids.d_protoBufData->d_requestorID; + } + return std::string(); + }, [](DNSQuestion& dq, const std::string& newValue) { + if (!dq.ids.d_protoBufData) { + dq.ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + dq.ids.d_protoBufData->d_requestorID = newValue; + }); luaCtx.registerFunction<bool(DNSQuestion::*)()const>("getDO", [](const DNSQuestion& dq) { return getEDNSZ(dq) & EDNS_HEADER_FLAG_DO; }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-lua-ffi-interface.h new/dnsdist-1.8.0-rc2/dnsdist-lua-ffi-interface.h --- old/dnsdist-1.8.0-rc1/dnsdist-lua-ffi-interface.h 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-lua-ffi-interface.h 2023-03-08 11:10:53.000000000 +0100 @@ -111,6 +111,10 @@ void dnsdist_ffi_dnsquestion_set_tag(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value) __attribute__ ((visibility ("default"))); void dnsdist_ffi_dnsquestion_set_tag_raw(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); +void dnsdist_ffi_dnsquestion_set_requestor_id(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); +void dnsdist_ffi_dnsquestion_set_device_id(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); +void dnsdist_ffi_dnsquestion_set_device_name(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); + void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, uint16_t statusCode, const char* body, size_t bodyLen, const char* contentType) __attribute__ ((visibility ("default"))); size_t dnsdist_ffi_dnsquestion_get_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char** out) __attribute__ ((visibility ("default"))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-lua-ffi-interface.inc new/dnsdist-1.8.0-rc2/dnsdist-lua-ffi-interface.inc --- old/dnsdist-1.8.0-rc1/dnsdist-lua-ffi-interface.inc 2023-02-22 15:04:20.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-lua-ffi-interface.inc 2023-03-08 11:11:45.000000000 +0100 @@ -112,6 +112,10 @@ void dnsdist_ffi_dnsquestion_set_tag(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value) __attribute__ ((visibility ("default"))); void dnsdist_ffi_dnsquestion_set_tag_raw(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); +void dnsdist_ffi_dnsquestion_set_requestor_id(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); +void dnsdist_ffi_dnsquestion_set_device_id(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); +void dnsdist_ffi_dnsquestion_set_device_name(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) __attribute__ ((visibility ("default"))); + void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, uint16_t statusCode, const char* body, size_t bodyLen, const char* contentType) __attribute__ ((visibility ("default"))); size_t dnsdist_ffi_dnsquestion_get_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char** out) __attribute__ ((visibility ("default"))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-lua-ffi.cc new/dnsdist-1.8.0-rc2/dnsdist-lua-ffi.cc --- old/dnsdist-1.8.0-rc1/dnsdist-lua-ffi.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-lua-ffi.cc 2023-03-08 11:10:53.000000000 +0100 @@ -512,6 +512,39 @@ dq->dq->setTag(label, std::string(value, valueSize)); } +void dnsdist_ffi_dnsquestion_set_requestor_id(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) +{ + if (!dq || !dq->dq || !value) { + return; + } + if (!dq->dq->ids.d_protoBufData) { + dq->dq->ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + dq->dq->ids.d_protoBufData->d_requestorID = std::string(value, valueSize); +} + +void dnsdist_ffi_dnsquestion_set_device_id(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) +{ + if (!dq || !dq->dq || !value) { + return; + } + if (!dq->dq->ids.d_protoBufData) { + dq->dq->ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + dq->dq->ids.d_protoBufData->d_deviceID = std::string(value, valueSize); +} + +void dnsdist_ffi_dnsquestion_set_device_name(dnsdist_ffi_dnsquestion_t* dq, const char* value, size_t valueSize) +{ + if (!dq || !dq->dq || !value) { + return; + } + if (!dq->dq->ids.d_protoBufData) { + dq->dq->ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(); + } + dq->dq->ids.d_protoBufData->d_deviceName = std::string(value, valueSize); +} + size_t dnsdist_ffi_dnsquestion_get_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char** out) { dq->trailingData = dq->dq->getTrailingData(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-protobuf.cc new/dnsdist-1.8.0-rc2/dnsdist-protobuf.cc --- old/dnsdist-1.8.0-rc1/dnsdist-protobuf.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-protobuf.cc 2023-03-08 11:10:53.000000000 +0100 @@ -154,7 +154,7 @@ protocol = pdns::ProtoZero::Message::TransportProtocol::DNSCryptTCP; } - m.setRequest(d_dq.ids.uniqueId ? *d_dq.ids.uniqueId : getUniqueID(), d_requestor ? *d_requestor : d_dq.ids.origRemote, d_responder ? *d_responder : d_dq.ids.origDest, d_question ? d_question->d_name : d_dq.ids.qname, d_question ? d_question->d_type : d_dq.ids.qtype, d_question ? d_question->d_class : d_dq.ids.qclass, d_dq.getHeader()->id, protocol, d_bytes ? *d_bytes : d_dq.getData().size()); + m.setRequest(d_dq.ids.d_protoBufData && d_dq.ids.d_protoBufData->uniqueId ? *d_dq.ids.d_protoBufData->uniqueId : getUniqueID(), d_requestor ? *d_requestor : d_dq.ids.origRemote, d_responder ? *d_responder : d_dq.ids.origDest, d_question ? d_question->d_name : d_dq.ids.qname, d_question ? d_question->d_type : d_dq.ids.qtype, d_question ? d_question->d_class : d_dq.ids.qclass, d_dq.getHeader()->id, protocol, d_bytes ? *d_bytes : d_dq.getData().size()); if (d_serverIdentity) { m.setServerIdentity(*d_serverIdentity); @@ -196,6 +196,19 @@ m.commitResponse(); + if (d_dq.ids.d_protoBufData) { + const auto& pbData = d_dq.ids.d_protoBufData; + if (!pbData->d_deviceName.empty()) { + m.setDeviceName(pbData->d_deviceName); + } + if (!pbData->d_deviceID.empty()) { + m.setDeviceId(pbData->d_deviceID); + } + if (!pbData->d_requestorID.empty()) { + m.setRequestorId(pbData->d_requestorID); + } + } + for (const auto& [key, values] : d_metaTags) { if (!values.empty()) { m.setMeta(key, values, {}); @@ -266,6 +279,7 @@ ProtoBufMetaKey::KeyTypeDescription{ "sni", Type::SNI, [](const DNSQuestion& dq, const std::string&, uint8_t) -> std::vector<std::string> { return {dq.sni}; }, false }, ProtoBufMetaKey::KeyTypeDescription{ "pool", Type::Pool, [](const DNSQuestion& dq, const std::string&, uint8_t) -> std::vector<std::string> { return {dq.ids.poolName}; }, false }, ProtoBufMetaKey::KeyTypeDescription{ "b64-content", Type::B64Content, [](const DNSQuestion& dq, const std::string&, uint8_t) -> std::vector<std::string> { const auto& data = dq.getData(); return {Base64Encode(std::string(data.begin(), data.end()))}; }, false }, +#ifdef HAVE_DNS_OVER_HTTPS ProtoBufMetaKey::KeyTypeDescription{ "doh-header", Type::DoHHeader, [](const DNSQuestion& dq , const std::string& name, uint8_t) -> std::vector<std::string> { if (!dq.ids.du) { return {}; @@ -301,6 +315,7 @@ } return {}; }, false, false }, +#endif // HAVE_DNS_OVER_HTTPS ProtoBufMetaKey::KeyTypeDescription{ "proxy-protocol-value", Type::ProxyProtocolValue, [](const DNSQuestion& dq, const std::string&, uint8_t numericSubKey) -> std::vector<std::string> { if (!dq.proxyProtocolValues) { return {}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist-tcp.cc new/dnsdist-1.8.0-rc2/dnsdist-tcp.cc --- old/dnsdist-1.8.0-rc1/dnsdist-tcp.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist-tcp.cc 2023-03-08 11:10:53.000000000 +0100 @@ -247,10 +247,10 @@ if (backendProtocol == dnsdist::Protocol::DoUDP) { backendProtocol = dnsdist::Protocol::DoTCP; } - ::handleResponseSent(ids, udiff, state->d_ci.remote, ds->d_config.remote, static_cast<unsigned int>(currentResponse.d_buffer.size()), currentResponse.d_cleartextDH, backendProtocol); + ::handleResponseSent(ids, udiff, state->d_ci.remote, ds->d_config.remote, static_cast<unsigned int>(currentResponse.d_buffer.size()), currentResponse.d_cleartextDH, backendProtocol, true); } else { const auto& ids = currentResponse.d_idstate; - ::handleResponseSent(ids, 0., state->d_ci.remote, ComboAddress(), static_cast<unsigned int>(currentResponse.d_buffer.size()), currentResponse.d_cleartextDH, ids.protocol); + ::handleResponseSent(ids, 0., state->d_ci.remote, ComboAddress(), static_cast<unsigned int>(currentResponse.d_buffer.size()), currentResponse.d_cleartextDH, ids.protocol, false); } currentResponse.d_buffer.clear(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist.1 new/dnsdist-1.8.0-rc2/dnsdist.1 --- old/dnsdist-1.8.0-rc1/dnsdist.1 2023-02-22 15:04:43.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist.1 2023-03-08 11:12:08.000000000 +0100 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "DNSDIST" "1" "Feb 22, 2023" "" "dnsdist" +.TH "DNSDIST" "1" "Mar 08, 2023" "" "dnsdist" .SH NAME dnsdist \- A DNS and DoS aware, scriptable loadbalancer .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist.cc new/dnsdist-1.8.0-rc2/dnsdist.cc --- old/dnsdist-1.8.0-rc1/dnsdist.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist.cc 2023-03-08 11:10:53.000000000 +0100 @@ -621,12 +621,12 @@ return true; } -void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol) +void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, bool fromBackend) { - handleResponseSent(ids.qname, ids.qtype, udiff, client, backend, size, cleartextDH, outgoingProtocol, ids.protocol); + handleResponseSent(ids.qname, ids.qtype, udiff, client, backend, size, cleartextDH, outgoingProtocol, ids.protocol, fromBackend); } -void handleResponseSent(const DNSName& qname, const QType& qtype, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, dnsdist::Protocol incomingProtocol) +void handleResponseSent(const DNSName& qname, const QType& qtype, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, dnsdist::Protocol incomingProtocol, bool fromBackend) { if (g_rings.shouldRecordResponses()) { struct timespec ts; @@ -639,7 +639,9 @@ ++g_stats.frontendNXDomain; break; case RCode::ServFail: - ++g_stats.servfailResponses; + if (fromBackend) { + ++g_stats.servfailResponses; + } ++g_stats.frontendServFail; break; case RCode::NoError: @@ -700,10 +702,10 @@ vinfolog("Got answer from %s, NOT relayed to %s (UDP) since that frontend is muted, took %f usec", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), udiff); } - handleResponseSent(ids, udiff, dr.ids.origRemote, ds->d_config.remote, response.size(), cleartextDH, ds->getProtocol()); + handleResponseSent(ids, udiff, dr.ids.origRemote, ds->d_config.remote, response.size(), cleartextDH, ds->getProtocol(), true); } else { - handleResponseSent(ids, 0., dr.ids.origRemote, ComboAddress(), response.size(), cleartextDH, dnsdist::Protocol::DoUDP); + handleResponseSent(ids, 0., dr.ids.origRemote, ComboAddress(), response.size(), cleartextDH, dnsdist::Protocol::DoUDP, false); } } @@ -1591,8 +1593,6 @@ ids.cs = &cs; ids.origRemote = remote; ids.hopRemote = remote; - ids.origDest = dest; - ids.hopLocal = dest; ids.protocol = dnsdist::Protocol::DoUDP; try { @@ -1601,7 +1601,18 @@ return; } /* dest might have been updated, if we managed to harvest the destination address */ - ids.origDest = dest; + if (dest.sin4.sin_family != 0) { + ids.origDest = dest; + ids.hopLocal = dest; + } + else { + /* if we have not been able to harvest the destination address, + we do NOT want to update dest or hopLocal, to let the kernel + pick the less terrible option, but we want to update origDest + which is used by rules and actions to at least the correct + address family */ + ids.origDest = cs.local; + } std::vector<ProxyProtocolValue> proxyProtocolValues; if (expectProxyProtocol && !handleProxyProtocol(remote, false, *holders.acl, query, ids.origRemote, ids.origDest, proxyProtocolValues)) { @@ -1634,9 +1645,6 @@ } ids.qname = DNSName(reinterpret_cast<const char*>(query.data()), query.size(), sizeof(dnsheader), false, &ids.qtype, &ids.qclass); - if (ids.origDest.sin4.sin_family == 0) { - ids.origDest = cs.local; - } if (ids.dnsCryptQuery) { ids.protocol = dnsdist::Protocol::DNSCryptUDP; } @@ -1670,7 +1678,7 @@ /* we use dest, always, because we don't want to use the listening address to send a response since it could be 0.0.0.0 */ sendUDPResponse(cs.udpFD, query, dq.ids.delayMsec, dest, remote); - handleResponseSent(dq.ids.qname, dq.ids.qtype, 0., remote, ComboAddress(), query.size(), *dh, dnsdist::Protocol::DoUDP, dnsdist::Protocol::DoUDP); + handleResponseSent(dq.ids.qname, dq.ids.qtype, 0., remote, ComboAddress(), query.size(), *dh, dnsdist::Protocol::DoUDP, dnsdist::Protocol::DoUDP, false); return; } @@ -2384,12 +2392,30 @@ _exit(EXIT_SUCCESS); } #else /* COVERAGE */ + +/* g++ defines __SANITIZE_THREAD__ + clang++ supports the nice __has_feature(thread_sanitizer), + let's merge them */ +#if defined(__has_feature) +#if __has_feature(thread_sanitizer) +#define __SANITIZE_THREAD__ 1 +#endif +#endif + static void sigTermHandler(int) { +#if !defined(__SANITIZE_THREAD__) + /* TSAN is rightfully unhappy about this: + WARNING: ThreadSanitizer: signal-unsafe call inside of a signal + This is not a real problem for us, as the worst case is that + we crash trying to exit, but let's try to avoid the warnings + in our tests. + */ if (g_syslog) { syslog(LOG_INFO, "Exiting on user request"); } std::cout<<"Exiting on user request"<<std::endl; +#endif /* __SANITIZE_THREAD__ */ _exit(EXIT_SUCCESS); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/dnsdist.hh new/dnsdist-1.8.0-rc2/dnsdist.hh --- old/dnsdist-1.8.0-rc1/dnsdist.hh 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/dnsdist.hh 2023-03-08 11:10:53.000000000 +0100 @@ -1233,5 +1233,5 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr<DownstreamState>& ss, const int sd, const PacketBuffer& request, bool healthCheck = false); bool sendUDPResponse(int origFD, const PacketBuffer& response, const int delayMsec, const ComboAddress& origDest, const ComboAddress& origRemote); -void handleResponseSent(const DNSName& qname, const QType& qtype, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, dnsdist::Protocol incomingProtocol); -void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol); +void handleResponseSent(const DNSName& qname, const QType& qtype, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, dnsdist::Protocol incomingProtocol, bool fromBackend); +void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, bool fromBackend); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/doh.cc new/dnsdist-1.8.0-rc2/doh.cc --- old/dnsdist-1.8.0-rc1/doh.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/doh.cc 2023-03-08 11:10:53.000000000 +0100 @@ -492,7 +492,7 @@ if (backendProtocol == dnsdist::Protocol::DoUDP && du->tcp) { backendProtocol = dnsdist::Protocol::DoTCP; } - handleResponseSent(du->ids, udiff, du->ids.origRemote, du->downstream->d_config.remote, du->response.size(), cleartextDH, backendProtocol); + handleResponseSent(du->ids, udiff, du->ids.origRemote, du->downstream->d_config.remote, du->response.size(), cleartextDH, backendProtocol, true); } ++g_stats.responses; @@ -733,7 +733,7 @@ if (du->response.size() >= sizeof(dnsheader) && du->contentType.empty()) { auto dh = reinterpret_cast<const struct dnsheader*>(du->response.data()); - handleResponseSent(du->ids.qname, QType(du->ids.qtype), 0., du->ids.origDest, ComboAddress(), du->response.size(), *dh, dnsdist::Protocol::DoH, dnsdist::Protocol::DoH); + handleResponseSent(du->ids.qname, QType(du->ids.qtype), 0., du->ids.origDest, ComboAddress(), du->response.size(), *dh, dnsdist::Protocol::DoH, dnsdist::Protocol::DoH, false); } handleImmediateResponse(std::move(du), "DoH self-answered response"); return; @@ -1737,7 +1737,7 @@ double udiff = du->ids.queryRealTime.udiff(); vinfolog("Got answer from %s, relayed to %s (https), took %f usec", du->downstream->d_config.remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff); - handleResponseSent(du->ids, udiff, dr.ids.origRemote, du->downstream->d_config.remote, du->response.size(), cleartextDH, du->downstream->getProtocol()); + handleResponseSent(du->ids, udiff, dr.ids.origRemote, du->downstream->d_config.remote, du->response.size(), cleartextDH, du->downstream->getProtocol(), true); ++g_stats.responses; if (du->ids.cs) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/ext/yahttp/yahttp/reqresp.hpp new/dnsdist-1.8.0-rc2/ext/yahttp/yahttp/reqresp.hpp --- old/dnsdist-1.8.0-rc1/ext/yahttp/yahttp/reqresp.hpp 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/ext/yahttp/yahttp/reqresp.hpp 2023-03-08 11:10:53.000000000 +0100 @@ -1,4 +1,4 @@ -#ifdef HAVE_CXX11 +#if __cplusplus >= 201103L #include <functional> #define HAVE_CPP_FUNC_PTR namespace funcptr = std; @@ -72,7 +72,7 @@ size_t operator()(const HTTPBase *doc __attribute__((unused)), std::ostream& os, bool chunked) const { char buf[4096]; size_t n,k; -#ifdef HAVE_CXX11 +#if __cplusplus >= 201103L std::ifstream ifs(path, std::ifstream::binary); #else std::ifstream ifs(path.c_str(), std::ifstream::binary); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/ext/yahttp/yahttp/router.cpp new/dnsdist-1.8.0-rc2/ext/yahttp/yahttp/router.cpp --- old/dnsdist-1.8.0-rc1/ext/yahttp/yahttp/router.cpp 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/ext/yahttp/yahttp/router.cpp 2023-03-08 11:10:53.000000000 +0100 @@ -98,7 +98,7 @@ void Router::printRoutes(std::ostream &os) { for(TRouteList::iterator i = routes.begin(); i != routes.end(); i++) { -#ifdef HAVE_CXX11 +#if __cplusplus >= 201103L std::streamsize ss = os.width(); std::ios::fmtflags ff = os.setf(std::ios::left); os.width(10); @@ -122,7 +122,7 @@ bool found = false; for(TRouteList::iterator i = routes.begin(); !found && i != routes.end(); i++) { -#ifdef HAVE_CXX11 +#if __cplusplus >= 201103L if (std::get<3>(*i) == name) { mask = std::get<1>(*i); method = std::get<0>(*i); found = true; } #else if (i->get<3>() == name) { mask = i->get<1>(); method = i->get<0>(); found = true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/ext/yahttp/yahttp/router.hpp new/dnsdist-1.8.0-rc2/ext/yahttp/yahttp/router.hpp --- old/dnsdist-1.8.0-rc1/ext/yahttp/yahttp/router.hpp 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/ext/yahttp/yahttp/router.hpp 2023-03-08 11:10:53.000000000 +0100 @@ -2,7 +2,7 @@ /* @file * @brief Defines router class and support structures */ -#ifdef HAVE_CXX11 +#if __cplusplus >= 201103L #include <functional> #include <tuple> #define HAVE_CPP_FUNC_PTR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/m4/pdns_d_fortify_source.m4 new/dnsdist-1.8.0-rc2/m4/pdns_d_fortify_source.m4 --- old/dnsdist-1.8.0-rc1/m4/pdns_d_fortify_source.m4 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/m4/pdns_d_fortify_source.m4 2023-03-08 11:10:53.000000000 +0100 @@ -27,9 +27,6 @@ AS_IF([test "x$enable_fortify_source" != "xno"], [ - OLD_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="-Wall -W -Werror $CXXFLAGS" - dnl Auto means the highest version we support, which is currently 3 AS_IF([test "x$enable_fortify_source" == "xauto"], [enable_fortify_source=3], @@ -40,29 +37,26 @@ AS_IF([test "x$enable_fortify_source" == "x3"], [ gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=3], [ CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 $CFLAGS" - CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 $OLD_CXXFLAGS" - ], [enable_fortify_source=2], - [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) + CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 $CXXFLAGS" + ], [enable_fortify_source=2]) ]) dnl If 2 is not supported, we try to fallback to 1 AS_IF([test "x$enable_fortify_source" == "x2"], [ gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=2], [ CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" - CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS" - ], [enable_fortify_source=1], - [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) + CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CXXFLAGS" + ], [enable_fortify_source=1]) ]) AS_IF([test "x$enable_fortify_source" == "x1"], [ gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=1], [ CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 $CFLAGS" - CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 $OLD_CXXFLAGS" - ], [enable_fortify_source=no], - [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) + CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 $CXXFLAGS" + ], [enable_fortify_source=no]) ]) - ], []) + ]) AC_MSG_CHECKING([whether FORTIFY_SOURCE is supported]) AC_MSG_RESULT([$enable_fortify_source]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/m4/pdns_enable_lto.m4 new/dnsdist-1.8.0-rc2/m4/pdns_enable_lto.m4 --- old/dnsdist-1.8.0-rc1/m4/pdns_enable_lto.m4 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/m4/pdns_enable_lto.m4 2023-03-08 11:10:53.000000000 +0100 @@ -7,40 +7,32 @@ AS_IF([test "x$enable_lto" != "xno"], [ - OLD_CXXFLAGS="$CXXFLAGS" - OLD_LDFLAGS="$LDFLAGS" - CXXFLAGS="-Wall -W -Werror $CXXFLAGS" - dnl If thin is not supported, we try to fallback to auto AS_IF([test "x$enable_lto" == "xthin"], [ gl_COMPILER_OPTION_IF([-flto=thin], [ CFLAGS="-flto=thin $CFLAGS" - CXXFLAGS="-flto=thin $OLD_CXXFLAGS" - LDFLAGS="-flto=thin $OLD_LDFLAGS" - ], [enable_lto=auto], - [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) + CXXFLAGS="-flto=thin $CXXFLAGS" + LDFLAGS="-flto=thin $LDFLAGS" + ], [enable_lto=auto]) ]) dnl If auto is not supported, we try to fallback -flto AS_IF([test "x$enable_lto" == "xauto"], [ gl_COMPILER_OPTION_IF([-flto=auto], [ CFLAGS="-flto=auto $CFLAGS" - CXXFLAGS="-flto=auto $OLD_CXXFLAGS" - LDFLAGS="-flto=auto $OLD_LDFLAGS" - ], [enable_lto=yes], - [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) + CXXFLAGS="-flto=auto $CXXFLAGS" + LDFLAGS="-flto=auto $LDFLAGS" + ], [enable_lto=yes]) ]) AS_IF([test "x$enable_lto" == "xyes"], [ gl_COMPILER_OPTION_IF([-flto], [ CFLAGS="-flto $CFLAGS" - CXXFLAGS="-flto $OLD_CXXFLAGS" - LDFLAGS="-flto $OLD_LDFLAGS" - ], [enable_lto=no], - [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) + CXXFLAGS="-flto $CXXFLAGS" + LDFLAGS="-flto $LDFLAGS" + ], [enable_lto=no]) ]) - - ], []) + ]) AC_MSG_CHECKING([whether link-time optimization is supported]) AC_MSG_RESULT([$enable_lto]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/test-dnsdist-lua-ffi.cc new/dnsdist-1.8.0-rc2/test-dnsdist-lua-ffi.cc --- old/dnsdist-1.8.0-rc1/test-dnsdist-lua-ffi.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/test-dnsdist-lua-ffi.cc 2023-03-08 11:10:53.000000000 +0100 @@ -345,6 +345,23 @@ dnsdist_ffi_dnsquestion_set_http_response(&lightDQ, 0U, nullptr, 0U, nullptr); } } + + const std::string deviceID{"my-device-id"}; + const std::string deviceName{"my-device-name"}; + const std::string requestorID{"my-requestor-ID"}; + dnsdist_ffi_dnsquestion_set_device_id(nullptr, nullptr, 0); + dnsdist_ffi_dnsquestion_set_device_id(&lightDQ, nullptr, 0); + dnsdist_ffi_dnsquestion_set_device_id(&lightDQ, deviceID.c_str(), deviceID.size()); + dnsdist_ffi_dnsquestion_set_device_name(nullptr, nullptr, 0); + dnsdist_ffi_dnsquestion_set_device_name(&lightDQ, nullptr, 0); + dnsdist_ffi_dnsquestion_set_device_name(&lightDQ, deviceName.c_str(), deviceName.size()); + dnsdist_ffi_dnsquestion_set_requestor_id(nullptr, nullptr, 0); + dnsdist_ffi_dnsquestion_set_requestor_id(&lightDQ, nullptr, 0); + dnsdist_ffi_dnsquestion_set_requestor_id(&lightDQ, requestorID.c_str(), requestorID.size()); + BOOST_REQUIRE(ids.d_protoBufData != nullptr); + BOOST_CHECK_EQUAL(ids.d_protoBufData->d_deviceID, deviceID); + BOOST_CHECK_EQUAL(ids.d_protoBufData->d_deviceName, deviceName); + BOOST_CHECK_EQUAL(ids.d_protoBufData->d_requestorID, requestorID); } BOOST_AUTO_TEST_CASE(test_Response) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdist-1.8.0-rc1/test-dnsdisttcp_cc.cc new/dnsdist-1.8.0-rc2/test-dnsdisttcp_cc.cc --- old/dnsdist-1.8.0-rc1/test-dnsdisttcp_cc.cc 2023-02-22 15:03:33.000000000 +0100 +++ new/dnsdist-1.8.0-rc2/test-dnsdisttcp_cc.cc 2023-03-08 11:10:53.000000000 +0100 @@ -59,7 +59,7 @@ return 0; } -void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol protocol) +void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol protocol, bool fromBackend) { }