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