• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/ppp


Commit MetaInfo

Revisão2e50db22360222a36f5a32eeabdf0daec39c61a9 (tree)
Hora2013-12-18 04:02:02
AutorElliott Hughes <enh@goog...>
CommiterChristopher Ferris

Mensagem de Log

Fix pppd to build with both old and uapi headers.

Bug: 11559337

(cherry picked from commit 5e0738a2d8667ec1ea629649edc4fc5ae453f4a1)

Change-Id: I7a25195e22b3b244e75c9f615c1233e34d92dc4d

Mudança Sumário

Diff

--- a/pppd/include/net/ppp_defs.h
+++ b/pppd/include/net/ppp_defs.h
@@ -38,6 +38,10 @@
3838 #ifndef _PPP_DEFS_H_
3939 #define _PPP_DEFS_H_
4040
41+#if defined(PPP_ADDRESS)
42+#define USING_UAPI
43+#endif
44+
4145 /*
4246 * The basic PPP frame.
4347 */
@@ -59,9 +63,11 @@
5963 #define PPP_MAXMRU 65000 /* Largest MRU we allow */
6064 #define PPP_MINMRU 128
6165
66+#if !defined(USING_UAPI)
6267 #define PPP_ADDRESS(p) (((u_char *)(p))[0])
6368 #define PPP_CONTROL(p) (((u_char *)(p))[1])
6469 #define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])
70+#endif
6571
6672 /*
6773 * Significant octet values.
@@ -124,6 +130,15 @@ typedef u_int32_t ext_accm[8];
124130 /*
125131 * What to do with network protocol (NP) packets.
126132 */
133+#if defined(USING_UAPI)
134+/* This stuff isn't in uapi. TODO: is there a newer pppd that doesn't use this? */
135+#define ifr__name b.ifr_ifrn.ifrn_name
136+#define stats_ptr b.ifr_ifru.ifru_data
137+struct ifpppstatsreq {
138+ struct ifreq b;
139+ struct ppp_stats stats;
140+};
141+#else
127142 enum NPmode {
128143 NPMODE_PASS, /* pass the packet through */
129144 NPMODE_DROP, /* silently drop the packet */
@@ -183,6 +198,8 @@ struct ppp_idle {
183198 time_t recv_idle; /* time since last NP packet received */
184199 };
185200
201+#endif
202+
186203 #ifndef __P
187204 #ifdef __STDC__
188205 #define __P(x) x
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -111,6 +111,7 @@
111111 #include <netinet/if_ether.h>
112112 #else
113113 #include <linux/types.h>
114+#include <linux/tty.h>
114115 #include <linux/if.h>
115116 #include <linux/if_arp.h>
116117 #include <linux/route.h>