summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Janda <felix.janda@posteo.de>2015-05-16 15:59:50 +0200
committerGert Doering <gert@greenie.muc.de>2015-05-16 20:41:46 +0200
commite9739fbf587e1b0516fa47b9576cc8be8b514d21 (patch)
tree8fe11fd0976c6f8f8f336f5da7da6b28142b242c
parent98e8dbbe3d0f8489fee0e814c57122097b16da20 (diff)
downloadopenvpn-e9739fbf587e1b0516fa47b9576cc8be8b514d21.tar.gz
openvpn-e9739fbf587e1b0516fa47b9576cc8be8b514d21.tar.xz
openvpn-e9739fbf587e1b0516fa47b9576cc8be8b514d21.zip
Use OPENVPN_ETH_P_* so that <netinet/if_ether.h> is unecessary
Fixes compilation error on linux with musl libc because of conflicting ethhdr declarations in <netinet/if_ether.h> and <linux/if_ether.h> which is included from <linux/if_tun.h> Signed-off-by: Felix Janda <felix.janda@posteo.de> Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: <20150516134604.GA2302@euler> URL: http://article.gmane.org/gmane.network.openvpn.devel/9690 Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit ddb1f20a9ddbb94956c9f7b1115c89543d9b411a)
-rw-r--r--configure.ac2
-rw-r--r--src/openvpn/syshead.h4
-rw-r--r--src/openvpn/tun.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 91e680e..9b8c380 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,7 +457,7 @@ SOCKET_INCLUDES="
"
AC_CHECK_HEADERS(
- [net/if.h netinet/ip.h netinet/if_ether.h resolv.h sys/un.h net/if_utun.h sys/kern_control.h],
+ [net/if.h netinet/ip.h resolv.h sys/un.h net/if_utun.h sys/kern_control.h],
,
,
[[${SOCKET_INCLUDES}]]
diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h
index f957a10..7075b96 100644
--- a/src/openvpn/syshead.h
+++ b/src/openvpn/syshead.h
@@ -214,10 +214,6 @@
#ifdef TARGET_LINUX
-#if defined(HAVE_NETINET_IF_ETHER_H)
-#include <netinet/if_ether.h>
-#endif
-
#ifdef HAVE_LINUX_IF_TUN_H
#include <linux/if_tun.h>
#endif
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index ba4b15e..9ca3ee2 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1710,9 +1710,9 @@ write_tun (struct tuntap* tt, uint8_t *buf, int len)
pi.flags = 0;
if(iph->version == 6)
- pi.proto = htons(ETH_P_IPV6);
+ pi.proto = htons(OPENVPN_ETH_P_IPV6);
else
- pi.proto = htons(ETH_P_IP);
+ pi.proto = htons(OPENVPN_ETH_P_IPV4);
vect[0].iov_len = sizeof(pi);
vect[0].iov_base = &pi;