1
0

140-pppoe_compile_fix.patch 2.2 KB

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