0002-iptunnel.c-do-not-include-netinet-ip.h.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 7a9a369d9de784791a2ab384877aab5ff3801d4e Mon Sep 17 00:00:00 2001
  2. From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  3. Date: Thu, 3 Nov 2016 12:59:39 +0000
  4. Subject: [PATCH] iptunnel.c: do not include netinet/ip.h
  5. This fixes a struct redefinition problem like this one:
  6. ================================
  7. In file included from /usr/include/linux/if_tunnel.h:6:0,
  8. from iptunnel.c:34:
  9. /usr/include/linux/ip.h:85:8: error: redefinition of 'struct iphdr'
  10. struct iphdr {
  11. ^
  12. In file included from iptunnel.c:29:0:
  13. /usr/include/netinet/ip.h:45:8: note: originally defined here
  14. struct iphdr
  15. ^
  16. ================================
  17. iptunnel.c includes netinet/ip.h which contains a definition of the
  18. iphdr struct.
  19. iptunnel.c also includes linux/if_tunnel.h which includes linux/ip.h
  20. which contains a definition of the iphdr struct.
  21. So, both netinet/ip.h and linux/ip.h define the iphdr struct, and both
  22. of them have been included directly or indirectly by iptunnel.c. Because
  23. of that the compilation fails due to a struct redefinition.
  24. The problem can be solved by just not including netinet/ip.h.
  25. Upstream status: merge request sent
  26. https://sourceforge.net/p/net-tools/code/merge-requests/3/
  27. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  28. ---
  29. iptunnel.c | 1 -
  30. 1 file changed, 1 deletion(-)
  31. diff --git a/iptunnel.c b/iptunnel.c
  32. index 3fe1b84..247ae10 100644
  33. --- a/iptunnel.c
  34. +++ b/iptunnel.c
  35. @@ -26,7 +26,6 @@
  36. #include <sys/socket.h>
  37. #include <sys/ioctl.h>
  38. #include <netinet/in.h>
  39. -#include <netinet/ip.h>
  40. #include <arpa/inet.h>
  41. #include <net/if.h>
  42. #include <net/if_arp.h>
  43. --
  44. 2.10.1