]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Use OPENVPN_ETH_P_* so that <netinet/if_ether.h> is unecessary
authorFelix Janda <felix.janda@posteo.de>
Sat, 16 May 2015 13:59:50 +0000 (15:59 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 16 May 2015 18:40:53 +0000 (20:40 +0200)
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>
configure.ac
src/openvpn/syshead.h
src/openvpn/tun.c

index 91324688141ad1cfd07343f8b9346ef08b3d2825..5dccfbbc920964634c64737bd288b24a228ed21b 100644 (file)
@@ -461,7 +461,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}]]
index b898bf2f363e4eb7e7f9c2b73318ebae9a8e165b..cf29131f2bc9fdb38d8bc0cb3afe25311ed27148 100644 (file)
 
 #if defined(TARGET_LINUX) || defined (TARGET_ANDROID)
 
-#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
index 11a6d714cd1dcb64c9df1f55cc8493a7a6e7e7a3..ce3ed853ba9b9d9957c97cf9ef2a4b7eff4e7f8d 100644 (file)
@@ -1856,9 +1856,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;