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