]> 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:41:46 +0000 (20:41 +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>
(cherry picked from commit ddb1f20a9ddbb94956c9f7b1115c89543d9b411a)

configure.ac
src/openvpn/syshead.h
src/openvpn/tun.c

index 91e680ef829a1be47d1add4d8b4fca3daac2ddfc..9b8c380ce34a5ef89277147c07a2452d15c52faf 100644 (file)
@@ -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}]]
index f957a10e2f6042ea97326798f6288ec4e5e16892..7075b9616ac70d53aca4cb4f4c16d8588f9a5070 100644 (file)
 
 #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
index ba4b15e1ca6d825c93bc89604f15cf7675961303..9ca3ee2008b67867855776b78169347bd4fc9fd5 100644 (file)
@@ -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;