summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-11-12 11:11:06 -0800
committerChristopher Ferris <cferris@google.com>2013-12-17 11:02:02 -0800
commit2e50db22360222a36f5a32eeabdf0daec39c61a9 (patch)
tree91cba3d4c4e694953f72605c4fee7b9be933d0cb
parent6c569d212164aa9334e27abac8884a3d13999420 (diff)
downloadppp-kitkat-mr2.1-release.tar.gz
Bug: 11559337 (cherry picked from commit 5e0738a2d8667ec1ea629649edc4fc5ae453f4a1) Change-Id: I7a25195e22b3b244e75c9f615c1233e34d92dc4d
-rw-r--r--pppd/include/net/ppp_defs.h17
-rw-r--r--pppd/sys-linux.c1
2 files changed, 18 insertions, 0 deletions
diff --git a/pppd/include/net/ppp_defs.h b/pppd/include/net/ppp_defs.h
index b06eda5..a21afdb 100644
--- a/pppd/include/net/ppp_defs.h
+++ b/pppd/include/net/ppp_defs.h
@@ -38,6 +38,10 @@
#ifndef _PPP_DEFS_H_
#define _PPP_DEFS_H_
+#if defined(PPP_ADDRESS)
+#define USING_UAPI
+#endif
+
/*
* The basic PPP frame.
*/
@@ -59,9 +63,11 @@
#define PPP_MAXMRU 65000 /* Largest MRU we allow */
#define PPP_MINMRU 128
+#if !defined(USING_UAPI)
#define PPP_ADDRESS(p) (((u_char *)(p))[0])
#define PPP_CONTROL(p) (((u_char *)(p))[1])
#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])
+#endif
/*
* Significant octet values.
@@ -124,6 +130,15 @@ typedef u_int32_t ext_accm[8];
/*
* What to do with network protocol (NP) packets.
*/
+#if defined(USING_UAPI)
+/* This stuff isn't in uapi. TODO: is there a newer pppd that doesn't use this? */
+#define ifr__name b.ifr_ifrn.ifrn_name
+#define stats_ptr b.ifr_ifru.ifru_data
+struct ifpppstatsreq {
+ struct ifreq b;
+ struct ppp_stats stats;
+};
+#else
enum NPmode {
NPMODE_PASS, /* pass the packet through */
NPMODE_DROP, /* silently drop the packet */
@@ -183,6 +198,8 @@ struct ppp_idle {
time_t recv_idle; /* time since last NP packet received */
};
+#endif
+
#ifndef __P
#ifdef __STDC__
#define __P(x) x
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index 0d2645a..8736534 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -111,6 +111,7 @@
#include <netinet/if_ether.h>
#else
#include <linux/types.h>
+#include <linux/tty.h>
#include <linux/if.h>
#include <linux/if_arp.h>
#include <linux/route.h>