0005-dumpfile_tuntap-don-t-include-linux-if_tun.h-kernel-.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 1466cbbdef835634366b2eb3a284fdff5833338c Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@gmail.com>
  3. Date: Fri, 19 Aug 2016 23:30:06 +0200
  4. Subject: [PATCH] dumpfile_tuntap: don't include linux/if_tun.h kernel header
  5. dumpfile_tuntap.h mixes userspace and kernel headers.
  6. As suggested in the musl wiki [1], remove the linux/include directives
  7. and copy the required definitions.
  8. [1] http://wiki.musl-libc.org/wiki/FAQ
  9. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  10. ---
  11. dumpfile_tuntap.h | 17 +++++++++--------
  12. 1 file changed, 9 insertions(+), 8 deletions(-)
  13. diff --git a/dumpfile_tuntap.h b/dumpfile_tuntap.h
  14. index 37f50b6..8b23a2a 100644
  15. --- a/dumpfile_tuntap.h
  16. +++ b/dumpfile_tuntap.h
  17. @@ -64,17 +64,18 @@
  18. #include "packetchain.h"
  19. #include "dumpfile.h"
  20. -#ifdef SYS_LINUX
  21. -#include <linux/if_tun.h>
  22. +#ifdef SYS_LINUX
  23. +/* TUNSETIFF ifr flags */
  24. +#define IFF_TUN 0x0001
  25. +#define IFF_TAP 0x0002
  26. +#define IFF_NO_PI 0x1000
  27. // Linux IEEE80211 link typ to set
  28. #define LNX_LINKTYPE_80211 801
  29. -// If the system headers don't have the TUNSETLINK ioctl, define it here,
  30. -// and we'll figure it out at runtime
  31. -#ifndef TUNSETLINK
  32. -#define TUNSETLINK _IOW('T', 205, int)
  33. -#endif
  34. -
  35. +/* Ioctl defines */
  36. +#define TUNSETNOCSUM _IOW('T', 200, int)
  37. +#define TUNSETIFF _IOW('T', 202, int)
  38. +#define TUNSETLINK _IOW('T', 205, int)
  39. #endif
  40. struct ipc_dft_open {
  41. --
  42. 2.5.5