Package: freebsd-utils / 10.1~svn273304-1

ppp_macros.diff Patch series | download
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
--- a/src/usr.sbin/ppp/bundle.c
+++ b/src/usr.sbin/ppp/bundle.c
@@ -699,7 +699,7 @@
   static struct bundle bundle;		/* there can be only one */
   int enoentcount, err, minunit, maxunit;
   const char *ifname;
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
   int kldtried;
 #endif
 #if defined(TUNSIFMODE) || defined(TUNSLMODE) || defined(TUNSIFHEAD)
@@ -720,7 +720,7 @@
   }
   err = ENOENT;
   enoentcount = 0;
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
   kldtried = 0;
 #endif
   for (bundle.unit = minunit; bundle.unit != maxunit; bundle.unit++) {
@@ -730,7 +730,7 @@
     if (bundle.dev.fd >= 0)
       break;
     else if (errno == ENXIO || errno == ENOENT) {
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
       if (bundle.unit == minunit && !kldtried++) {
         /*
          * Attempt to load the tunnel interface KLD if it isn't loaded
--- a/src/usr.sbin/ppp/cbcp.c
+++ b/src/usr.sbin/ppp/cbcp.c
@@ -28,7 +28,7 @@
 
 #include <sys/param.h>
 
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #include <netinet/in.h>
 #endif
 #include <sys/un.h>
--- a/src/usr.sbin/ppp/chap_ms.c
+++ b/src/usr.sbin/ppp/chap_ms.c
@@ -29,8 +29,9 @@
  * $FreeBSD$
  */
 
+#include <sys/param.h>
 #include <ctype.h>
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #include <openssl/des.h>
 #include <sha.h>
 #else
@@ -187,7 +188,7 @@
   ChallengeResponse(Challenge, PasswordHash, Response);
 }
 
-#ifndef __FreeBSD__
+#ifndef __FreeBSD_kernel__
 #define LENGTH 20
 static char *
 SHA1_End(SHA_CTX *ctx, char *buf)
--- a/src/usr.sbin/ppp/defs.c
+++ b/src/usr.sbin/ppp/defs.c
@@ -39,16 +39,16 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 #include <sys/module.h>
 #endif
 #include <termios.h>
-#ifndef __FreeBSD__
+#ifndef __FreeBSD_kernel__
 #include <time.h>
 #endif
 #include <unistd.h>
 
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 #include "id.h"
 #include "log.h"
 #endif
@@ -411,7 +411,7 @@
   }
 }
 
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 int
 loadmodules(int how, const char *module, ...)
 {
--- a/src/usr.sbin/ppp/defs.h
+++ b/src/usr.sbin/ppp/defs.h
@@ -28,8 +28,10 @@
  * $FreeBSD$
  */
 
+#include <sys/param.h>
+
 /* Check the following definitions for your machine environment */
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 # define  MODEM_LIST	"/dev/cuau1\0/dev/cuau0"	/* name of tty device */
 #else
 # ifdef __OpenBSD__
--- a/src/usr.sbin/ppp/id.c
+++ b/src/usr.sbin/ppp/id.c
@@ -40,7 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sysexits.h>
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 #include <sys/linker.h>
 #endif
 #include <unistd.h>
@@ -262,7 +262,7 @@
   return result;
 }
 
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 int
 ID0kldload(const char *dev)
 {
--- a/src/usr.sbin/ppp/id.h
+++ b/src/usr.sbin/ppp/id.h
@@ -26,6 +26,8 @@
  * $FreeBSD$
  */
 
+#include <sys/param.h>
+
 #ifndef NOSUID
 struct utmpx;
 struct sockaddr_un;
@@ -46,7 +48,7 @@
 extern int ID0bind_un(int, const struct sockaddr_un *);
 extern int ID0connect_un(int, const struct sockaddr_un *);
 extern int ID0kill(pid_t, int);
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 extern int ID0kldload(const char *);
 #endif
 #ifndef NONETGRAPH
@@ -70,7 +72,7 @@
 #define ID0connect_un(s, n) \
 	connect(s, (const struct sockaddr *)(n), sizeof *(n))
 #define ID0kill kill
-#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
+#if defined(__FreeBSD_kernel__) && !defined(NOKLDLOAD)
 #include <sys/param.h>
 #include <sys/linker.h>
 #define ID0kldload kldload
--- a/src/usr.sbin/ppp/iface.c
+++ b/src/usr.sbin/ppp/iface.c
@@ -31,7 +31,7 @@
 #include <netinet/in.h>
 #include <net/if.h>
 #include <net/if_dl.h>
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #include <net/if_var.h>
 #endif
 #include <net/route.h>
@@ -666,7 +666,7 @@
     close(s);
     return 0;
   }
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
   new_flags = (ifrq.ifr_flags & 0xffff) | (ifrq.ifr_flagshigh << 16);
 #else
   new_flags = ifrq.ifr_flags & 0xffff;
@@ -677,7 +677,7 @@
   else
     new_flags &= ~flags;
   ifrq.ifr_flags = new_flags & 0xffff;
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
   ifrq.ifr_flagshigh = new_flags >> 16;
 #endif
 
--- a/src/usr.sbin/ppp/lqr.c
+++ b/src/usr.sbin/ppp/lqr.c
@@ -30,7 +30,7 @@
 
 #include <sys/param.h>
 
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #include <netinet/in.h>
 #endif
 #include <sys/un.h>
--- a/src/usr.sbin/ppp/tun.c
+++ b/src/usr.sbin/ppp/tun.c
@@ -29,7 +29,7 @@
 #include <sys/param.h>
 
 #include <sys/socket.h>		/* For IFF_ defines */
-#ifndef __FreeBSD__
+#ifndef __FreeBSD_kernel__
 #include <net/if.h>		/* For IFF_ defines */
 #endif
 #include <net/route.h>