0001-Fix-build-with-musl.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. From e50cdaed07e51f2508f94eb1f34fe43776e4ca78 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Fri, 29 May 2015 14:57:05 -0700
  4. Subject: [PATCH] Fix build with musl
  5. There are several assumption about glibc
  6. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  7. Upstream-Status: Pending
  8. ---
  9. include/net/ppp_defs.h | 2 ++
  10. pppd/Makefile.linux | 2 +-
  11. pppd/plugins/rp-pppoe/config.h | 3 ++-
  12. pppd/plugins/rp-pppoe/plugin.c | 1 -
  13. pppd/plugins/rp-pppoe/pppoe-discovery.c | 8 ++++----
  14. pppd/plugins/rp-pppoe/pppoe.h | 2 +-
  15. pppd/sys-linux.c | 3 ++-
  16. 7 files changed, 12 insertions(+), 9 deletions(-)
  17. diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
  18. index b06eda5..dafa36c 100644
  19. --- a/include/net/ppp_defs.h
  20. +++ b/include/net/ppp_defs.h
  21. @@ -38,6 +38,8 @@
  22. #ifndef _PPP_DEFS_H_
  23. #define _PPP_DEFS_H_
  24. +#include <sys/time.h>
  25. +
  26. /*
  27. * The basic PPP frame.
  28. */
  29. diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
  30. index 4e485a1..76411bc 100644
  31. --- a/pppd/Makefile.linux
  32. +++ b/pppd/Makefile.linux
  33. @@ -131,7 +131,7 @@ LIBS += -lcrypt
  34. endif
  35. ifdef USE_LIBUTIL
  36. -CFLAGS += -DHAVE_LOGWTMP=1
  37. +#CFLAGS += -DHAVE_LOGWTMP=1
  38. LIBS += -lutil
  39. endif
  40. diff --git a/pppd/plugins/rp-pppoe/config.h b/pppd/plugins/rp-pppoe/config.h
  41. index a708859..4a16a88 100644
  42. --- a/pppd/plugins/rp-pppoe/config.h
  43. +++ b/pppd/plugins/rp-pppoe/config.h
  44. @@ -78,8 +78,9 @@
  45. #define HAVE_NET_IF_ARP_H 1
  46. /* Define if you have the <net/ethernet.h> header file. */
  47. +#ifdef __GLIBC__
  48. #define HAVE_NET_ETHERNET_H 1
  49. -
  50. +#endif
  51. /* Define if you have the <net/if.h> header file. */
  52. #define HAVE_NET_IF_H 1
  53. diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
  54. index 44e0c31..93c0906 100644
  55. --- a/pppd/plugins/rp-pppoe/plugin.c
  56. +++ b/pppd/plugins/rp-pppoe/plugin.c
  57. @@ -46,7 +46,6 @@ static char const RCSID[] =
  58. #include <unistd.h>
  59. #include <fcntl.h>
  60. #include <signal.h>
  61. -#include <net/ethernet.h>
  62. #include <net/if_arp.h>
  63. #include <linux/ppp_defs.h>
  64. #include <linux/if_pppox.h>
  65. diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
  66. index f19c6d8..f45df2c 100644
  67. --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
  68. +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
  69. @@ -29,10 +29,6 @@
  70. #include <linux/if_packet.h>
  71. #endif
  72. -#ifdef HAVE_NET_ETHERNET_H
  73. -#include <net/ethernet.h>
  74. -#endif
  75. -
  76. #ifdef HAVE_ASM_TYPES_H
  77. #include <asm/types.h>
  78. #endif
  79. diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
  80. index a4e7d5c..de191c8 100644
  81. --- a/pppd/plugins/rp-pppoe/pppoe.h
  82. +++ b/pppd/plugins/rp-pppoe/pppoe.h
  83. @@ -90,7 +90,7 @@ typedef unsigned long UINT32_t;
  84. #ifdef HAVE_SYS_SOCKET_H
  85. #include <sys/socket.h>
  86. #endif
  87. -#ifndef HAVE_SYS_DLPI_H
  88. +#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H
  89. #include <netinet/if_ether.h>
  90. #endif
  91. #endif
  92. diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
  93. index a0531e9..84ee394 100644
  94. --- a/pppd/sys-linux.c
  95. +++ b/pppd/sys-linux.c
  96. @@ -112,7 +112,7 @@
  97. #include <linux/types.h>
  98. #include <linux/if.h>
  99. #include <linux/if_arp.h>
  100. -#include <linux/route.h>
  101. +/* #include <linux/route.h> */
  102. #include <linux/if_ether.h>
  103. #endif
  104. #include <netinet/in.h>
  105. @@ -145,6 +145,7 @@
  106. #endif
  107. #ifdef INET6
  108. +#include <net/route.h>
  109. #ifndef _LINUX_IN6_H
  110. /*
  111. * This is in linux/include/net/ipv6.h.
  112. --
  113. 2.17.1