|
@@ -0,0 +1,67 @@
|
|
1
|
+--- a/cmake/checks.cmake
|
|
2
|
++++ b/cmake/checks.cmake
|
|
3
|
+@@ -54,9 +54,13 @@ if(NOT DARWIN)
|
|
4
|
+ endif(NOT DARWIN)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
++set(CMAKE_EXTRA_INCLUDE_FILES "linux/if_ether.h")
|
|
8
|
++check_type_size("struct ethhdr" SIZEOF_ETHHDR)
|
|
9
|
++string(COMPARE NOTEQUAL "${SIZEOF_ETHHDR}" "" HAVE_LINUX_ETHHDR)
|
|
10
|
++
|
|
11
|
+ set(CMAKE_EXTRA_INCLUDE_FILES "netinet/if_ether.h")
|
|
12
|
+ check_type_size("struct ethhdr" SIZEOF_ETHHDR)
|
|
13
|
+-string(COMPARE NOTEQUAL "${SIZEOF_ETHHDR}" "" HAVE_ETHHDR)
|
|
14
|
++string(COMPARE NOTEQUAL "${SIZEOF_ETHHDR}" "" HAVE_NETINET_ETHHDR)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+ set(CMAKE_REQUIRED_INCLUDES "sys/types.h")
|
|
18
|
+--- a/src/compat.h
|
|
19
|
++++ b/src/compat.h
|
|
20
|
+@@ -45,7 +45,12 @@
|
|
21
|
+ #include <net/if.h>
|
|
22
|
+ #include <net/if_arp.h>
|
|
23
|
+ #include <netinet/in.h>
|
|
24
|
++
|
|
25
|
++#if defined(HAVE_LINUX_ETHHDR)
|
|
26
|
++#include <linux/if_ether.h>
|
|
27
|
++#elif defined(HAVE_NETINET_ETHHDR)
|
|
28
|
+ #include <netinet/if_ether.h>
|
|
29
|
++#endif
|
|
30
|
+
|
|
31
|
+ #ifndef ETH_ALEN
|
|
32
|
+ /** The length of a MAC address */
|
|
33
|
+@@ -55,9 +60,8 @@
|
|
34
|
+ #ifndef ETH_HLEN
|
|
35
|
+ /** The length of the standard ethernet header */
|
|
36
|
+ #define ETH_HLEN 14
|
|
37
|
+-#endif
|
|
38
|
+
|
|
39
|
+-#ifndef HAVE_ETHHDR
|
|
40
|
++#if !defined(HAVE_LINUX_ETHHDR) && !defined(HAVE_NETINET_ETHHDR)
|
|
41
|
+ /** An ethernet header */
|
|
42
|
+ struct ethhdr {
|
|
43
|
+ uint8_t h_dest[ETH_ALEN]; /**< The destination MAC address field */
|
|
44
|
+@@ -65,6 +69,7 @@ struct ethhdr {
|
|
45
|
+ uint16_t h_proto; /**< The EtherType/length field */
|
|
46
|
+ } __attribute__((packed));
|
|
47
|
+ #endif
|
|
48
|
++#endif
|
|
49
|
+
|
|
50
|
+ #if defined(USE_FREEBIND) && !defined(IP_FREEBIND)
|
|
51
|
+ /** Compatiblity define for systems supporting, but not defining IP_FREEBIND */
|
|
52
|
+--- a/src/fastd_config.h.in
|
|
53
|
++++ b/src/fastd_config.h.in
|
|
54
|
+@@ -35,8 +35,11 @@
|
|
55
|
+ /** Defined if the platform supports the AI_ADDRCONFIG flag to getaddrinfo() */
|
|
56
|
+ #cmakedefine HAVE_AI_ADDRCONFIG
|
|
57
|
+
|
|
58
|
+-/** Defined if the platform defines the \e ethhdr struct */
|
|
59
|
+-#cmakedefine HAVE_ETHHDR
|
|
60
|
++/** Defined if the platform defines the \e ethhdr struct through linux/if_ether.h */
|
|
61
|
++#cmakedefine HAVE_LINUX_ETHHDR
|
|
62
|
++
|
|
63
|
++/** Defined if the platform defines the \e ethhdr struct through netinet/if_ether.h */
|
|
64
|
++#cmakedefine HAVE_NETINET_ETHHDR
|
|
65
|
+
|
|
66
|
+ /** Defined if the platform defines get_current_dir_name() */
|
|
67
|
+ #cmakedefine HAVE_GET_CURRENT_DIR_NAME
|