summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
blob: 65291368bd6e6e4490a772d5c468cdf9904f6c44 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
From e50cdaed07e51f2508f94eb1f34fe43776e4ca78 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 May 2015 14:57:05 -0700
Subject: [PATCH] Fix build with musl

There are several assumption about glibc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
---
 include/net/ppp_defs.h                  | 2 ++
 pppd/Makefile.linux                     | 2 +-
 pppd/plugins/rp-pppoe/config.h          | 3 ++-
 pppd/plugins/rp-pppoe/plugin.c          | 1 -
 pppd/plugins/rp-pppoe/pppoe-discovery.c | 8 ++++----
 pppd/plugins/rp-pppoe/pppoe.h           | 2 +-
 pppd/sys-linux.c                        | 3 ++-
 7 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
index b06eda5..dafa36c 100644
--- a/include/net/ppp_defs.h
+++ b/include/net/ppp_defs.h
@@ -38,6 +38,8 @@
 #ifndef _PPP_DEFS_H_
 #define _PPP_DEFS_H_
 
+#include <sys/time.h>
+
 /*
  * The basic PPP frame.
  */
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index 4e485a1..76411bc 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -131,7 +131,7 @@ LIBS	+= -lcrypt
 endif
 
 ifdef USE_LIBUTIL
-CFLAGS	+= -DHAVE_LOGWTMP=1
+#CFLAGS	+= -DHAVE_LOGWTMP=1
 LIBS	+= -lutil
 endif
 
diff --git a/pppd/plugins/rp-pppoe/config.h b/pppd/plugins/rp-pppoe/config.h
index a708859..4a16a88 100644
--- a/pppd/plugins/rp-pppoe/config.h
+++ b/pppd/plugins/rp-pppoe/config.h
@@ -78,8 +78,9 @@
 #define HAVE_NET_IF_ARP_H 1
 
 /* Define if you have the <net/ethernet.h> header file.  */
+#ifdef __GLIBC__
 #define HAVE_NET_ETHERNET_H 1
-
+#endif
 /* Define if you have the <net/if.h> header file.  */
 #define HAVE_NET_IF_H 1
 
diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
index 44e0c31..93c0906 100644
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -46,7 +46,6 @@ 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>
diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
index f19c6d8..f45df2c 100644
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -29,10 +29,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
diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
index a4e7d5c..de191c8 100644
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -90,7 +90,7 @@ typedef unsigned long UINT32_t;
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#ifndef HAVE_SYS_DLPI_H
+#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H
 #include <netinet/if_ether.h>
 #endif
 #endif
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index a0531e9..84ee394 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -112,7 +112,7 @@
 #include <linux/types.h>
 #include <linux/if.h>
 #include <linux/if_arp.h>
-#include <linux/route.h>
+/* #include <linux/route.h> */
 #include <linux/if_ether.h>
 #endif
 #include <netinet/in.h>
@@ -145,6 +145,7 @@
 #endif
 
 #ifdef INET6
+#include <net/route.h>
 #ifndef _LINUX_IN6_H
 /*
  *    This is in linux/include/net/ipv6.h.
-- 
2.17.1