summaryrefslogtreecommitdiffstats
path: root/xsk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'xsk.cc')
-rw-r--r--xsk.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/xsk.cc b/xsk.cc
index 72f4791..e507c0f 100644
--- a/xsk.cc
+++ b/xsk.cc
@@ -29,15 +29,6 @@
#include <cstring>
#include <fcntl.h>
#include <iterator>
-#include <linux/bpf.h>
-#include <linux/if_ether.h>
-#include <linux/if_link.h>
-#include <linux/if_xdp.h>
-#include <linux/ip.h>
-#include <linux/ipv6.h>
-#include <linux/tcp.h>
-#include <linux/types.h>
-#include <linux/udp.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
@@ -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 <linux/bpf.h>
+#include <linux/if_ether.h>
+#include <linux/if_link.h>
+#include <linux/if_xdp.h>
+#include <linux/ip.h>
+#include <linux/ipv6.h>
+#include <linux/tcp.h>
+#include <linux/types.h>
+#include <linux/udp.h>
+
#ifdef DEBUG_UMEM
namespace
{