140-pppoe_compile_fix.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --- a/pppd/plugins/rp-pppoe/plugin.c
  2. +++ b/pppd/plugins/rp-pppoe/plugin.c
  3. @@ -46,9 +46,9 @@ static char const RCSID[] =
  4. #include <unistd.h>
  5. #include <fcntl.h>
  6. #include <signal.h>
  7. -#include <net/ethernet.h>
  8. #include <net/if_arp.h>
  9. #include <linux/ppp_defs.h>
  10. +#include <linux/if_ether.h>
  11. #include <linux/if_ppp.h>
  12. #include <linux/if_pppox.h>
  13. --- a/pppd/plugins/rp-pppoe/pppoe.h
  14. +++ b/pppd/plugins/rp-pppoe/pppoe.h
  15. @@ -86,17 +86,6 @@ typedef unsigned long UINT32_t;
  16. #include <netinet/in.h>
  17. -#ifdef HAVE_NETINET_IF_ETHER_H
  18. -#include <sys/types.h>
  19. -
  20. -#ifdef HAVE_SYS_SOCKET_H
  21. -#include <sys/socket.h>
  22. -#endif
  23. -#ifndef HAVE_SYS_DLPI_H
  24. -#include <netinet/if_ether.h>
  25. -#endif
  26. -#endif
  27. -
  28. /* Ethernet frame types according to RFC 2516 */
  29. --- a/pppd/plugins/rp-pppoe/if.c
  30. +++ b/pppd/plugins/rp-pppoe/if.c
  31. @@ -31,7 +31,7 @@ static char const RCSID[] =
  32. #endif
  33. #ifdef HAVE_NET_ETHERNET_H
  34. -#include <net/ethernet.h>
  35. +#include <linux/if_ether.h>
  36. #endif
  37. #ifdef HAVE_ASM_TYPES_H
  38. --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
  39. +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
  40. @@ -16,6 +16,7 @@
  41. #include <string.h>
  42. #include "pppoe.h"
  43. +#include "pppd/pppd.h"
  44. #ifdef HAVE_UNISTD_H
  45. #include <unistd.h>
  46. @@ -27,10 +28,6 @@
  47. #include <linux/if_packet.h>
  48. #endif
  49. -#ifdef HAVE_NET_ETHERNET_H
  50. -#include <net/ethernet.h>
  51. -#endif
  52. -
  53. #ifdef HAVE_ASM_TYPES_H
  54. #include <asm/types.h>
  55. #endif
  56. @@ -717,6 +714,23 @@ char *xstrdup(const char *s)
  57. return ret;
  58. }
  59. +void
  60. +error(char *fmt, ...)
  61. +{
  62. + va_list pvar;
  63. +
  64. +#if defined(__STDC__)
  65. + va_start(pvar, fmt);
  66. +#else
  67. + char *fmt;
  68. + va_start(pvar);
  69. + fmt = va_arg(pvar, char *);
  70. +#endif
  71. +
  72. + fprintf(stderr, fmt, pvar);
  73. + va_end(pvar);
  74. +}
  75. +
  76. void usage(void)
  77. {
  78. fprintf(stderr, "Usage: pppoe-discovery [options]\n");
  79. --- a/pppd/plugins/rp-pppoe/Makefile.linux
  80. +++ b/pppd/plugins/rp-pppoe/Makefile.linux
  81. @@ -33,7 +33,7 @@ pppoe-discovery: pppoe-discovery.o debug
  82. $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
  83. pppoe-discovery.o: pppoe-discovery.c
  84. - $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
  85. + $(CC) $(CFLAGS) -I../../.. -c -o pppoe-discovery.o pppoe-discovery.c
  86. debug.o: debug.c
  87. $(CC) $(CFLAGS) -c -o debug.o debug.c