aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch
blob: 75180fe32f9102d178d8c2b10e3a0b9f6b2d295e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 5bba224edea38607e8732081f86679ffd8b218ab Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 20 Jul 2017 04:29:04 -0700
Subject: [PATCH 2/2] lib/netdev: Adjust header include sequence

Specify libc headers before kernel UAPIs
this helps compiling with musl where otherwise
it uses the definition from kernel and complains
about double definition in libc headers

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 lib/netdev.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/netdev.c b/lib/netdev.c
index 3b6fbc5..c7de25e 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -39,7 +39,6 @@
 #include <fcntl.h>
 #include <arpa/inet.h>
 #include <inttypes.h>
-#include <linux/if_tun.h>
 
 /* Fix for some compile issues we were experiencing when setting up openwrt
  * with the 2.4 kernel. linux/ethtool.h seems to use kernel-style inttypes,
@@ -57,10 +56,6 @@
 #define s64 __s64
 #endif
 
-#include <linux/ethtool.h>
-#include <linux/rtnetlink.h>
-#include <linux/sockios.h>
-#include <linux/version.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
@@ -68,12 +63,16 @@
 #include <net/ethernet.h>
 #include <net/if.h>
 #include <net/if_arp.h>
-#include <net/if_packet.h>
 #include <net/route.h>
 #include <netinet/in.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <linux/ethtool.h>
+#include <linux/rtnetlink.h>
+#include <linux/sockios.h>
+#include <linux/version.h>
+#include <linux/if_tun.h>
 
 #include "fatal-signal.h"
 #include "list.h"
-- 
2.13.3