From: Remi Gacogne Date: Fri, 5 Apr 2024 08:20:49 +0000 (+0200) Subject: dnsdist: Fix "C++ One Definition Rule" warnings in XSK X-Git-Tag: rec-5.1.0-alpha1~36^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14037%2Fhead;p=thirdparty%2Fpdns.git 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 --- 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 {