0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 2e2eab070384834036c1458c669070ed17d81dbe Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 10 Feb 2016 23:15:36 +0100
  4. Subject: [PATCH] sysdep.c: don't include <linux/if_tun.h> on Linux
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Including <linux/if_tun.h> in sysdep.c is not necessary since sysdep.h
  9. already includes <netinet/if_ether.h>. And this is actually
  10. potentially harmful since both files redefine the same 'struct
  11. ethhdr', causing the following build failure with the musl C library:
  12. In file included from sysdep.h:28:0,
  13. from sysdep.c:71:
  14. .../buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/netinet/if_ether.h:96:8: error: redefinition of ‘struct ethhdr’
  15. struct ethhdr {
  16. ^
  17. In file included from .../buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/if_tun.h:20:0,
  18. from sysdep.c:62:
  19. .../buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/if_ether.h:138:8: note: originally defined here
  20. struct ethhdr {
  21. ^
  22. Original patch from:
  23. http://git.alpinelinux.org/cgit/aports/tree/testing/vpnc/working.patch
  24. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  25. ---
  26. sysdep.c | 4 +---
  27. 1 file changed, 1 insertion(+), 3 deletions(-)
  28. diff --git a/sysdep.c b/sysdep.c
  29. index d8f181d..f83543d 100644
  30. --- a/sysdep.c
  31. +++ b/sysdep.c
  32. @@ -58,13 +58,11 @@
  33. #if defined(__DragonFly__)
  34. #include <net/tun/if_tun.h>
  35. -#elif defined(__linux__)
  36. -#include <linux/if_tun.h>
  37. #elif defined(__APPLE__)
  38. /* no header for tun */
  39. #elif defined(__CYGWIN__)
  40. #include "tap-win32.h"
  41. -#else
  42. +#elif !defined(__linux__)
  43. #include <net/if_tun.h>
  44. #endif
  45. --
  46. 2.6.4