odhcpd: update to latest git HEAD
[oweals/openwrt.git] / package / network / services / ppp / patches / 140-pppoe_compile_fix.patch
1 --- a/pppd/plugins/rp-pppoe/pppoe.h
2 +++ b/pppd/plugins/rp-pppoe/pppoe.h
3 @@ -48,11 +48,7 @@
4  #endif
5  
6  /* Ugly header files on some Linux boxes... */
7 -#if defined(HAVE_LINUX_IF_H)
8 -#include <linux/if.h>
9 -#elif defined(HAVE_NET_IF_H)
10  #include <net/if.h>
11 -#endif
12  
13  #ifdef HAVE_NET_IF_TYPES_H
14  #include <net/if_types.h>
15 @@ -80,22 +76,8 @@ typedef unsigned long UINT32_t;
16  #error Could not find a 32-bit integer type
17  #endif
18  
19 -#ifdef HAVE_LINUX_IF_ETHER_H
20 -#include <linux/if_ether.h>
21 -#endif
22 -
23  #include <netinet/in.h>
24 -
25 -#ifdef HAVE_NETINET_IF_ETHER_H
26 -#include <sys/types.h>
27 -
28 -#ifdef HAVE_SYS_SOCKET_H
29 -#include <sys/socket.h>
30 -#endif
31 -#ifndef HAVE_SYS_DLPI_H
32 -#include <netinet/if_ether.h>
33 -#endif
34 -#endif
35 +#include <net/ethernet.h>
36  
37  
38  
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  
44  #include "pppoe.h"
45 +#include "pppd/pppd.h"
46  
47  #ifdef HAVE_UNISTD_H
48  #include <unistd.h>
49 @@ -717,6 +718,23 @@ char *xstrdup(const char *s)
50      return ret;
51  }
52  
53 +void
54 +error(char *fmt, ...)
55 +{
56 +    va_list pvar;
57 +
58 +#if defined(__STDC__)
59 +    va_start(pvar, fmt);
60 +#else
61 +    char *fmt;
62 +    va_start(pvar);
63 +    fmt = va_arg(pvar, char *);
64 +#endif
65 +
66 +    fprintf(stderr, fmt, pvar);
67 +    va_end(pvar);
68 +}
69 +
70  void usage(void)
71  {
72      fprintf(stderr, "Usage: pppoe-discovery [options]\n");
73 --- a/pppd/plugins/rp-pppoe/Makefile.linux
74 +++ b/pppd/plugins/rp-pppoe/Makefile.linux
75 @@ -33,7 +33,7 @@ pppoe-discovery: pppoe-discovery.o debug
76         $(CC) $(CFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
77  
78  pppoe-discovery.o: pppoe-discovery.c
79 -       $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
80 +       $(CC) $(CFLAGS) -I../../.. -c -o pppoe-discovery.o pppoe-discovery.c
81  
82  debug.o: debug.c
83         $(CC) $(CFLAGS) -c -o debug.o debug.c