From 679360ad842c60e38f4009cecac6e1422c747889 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 5 Apr 2024 10:20:49 +0200 Subject: [PATCH] dnsdist: Fix "C++ One Definition Rule" warnings in XSK It turns out we need to include the linux specific headers AFTER the regular ones, because it then detects that some types have already been defined (`sockaddr_in6` for example) and does not attempt to re-define them, which otherwise breaks the C++ One Definition Rule --- pdns/xsk.cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pdns/xsk.cc b/pdns/xsk.cc index 72f4791dd8..e507c0f889 100644 --- a/pdns/xsk.cc +++ b/pdns/xsk.cc @@ -29,15 +29,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -61,6 +52,21 @@ extern "C" #include "gettime.hh" #include "xsk.hh" +/* we need to include the linux specific headers AFTER the regular + ones, because it then detects that some types have already been + defined (sockaddr_in6 for example) and does not attempt to + re-define them, which otherwise breaks the C++ One Definition Rule +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + #ifdef DEBUG_UMEM namespace { -- 2.47.2