summaryrefslogtreecommitdiff
path: root/net/mouse-pppoe/patches/patch-aa
blob: 34f04cf7905cbad0beadcdcedb09e8a4ad3e9f59 (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
$NetBSD: patch-aa,v 1.4 2008/10/02 17:01:16 joerg Exp $

--- pppoe.c.orig	2000-04-21 05:58:32.000000000 +0200
+++ pppoe.c
@@ -5,6 +5,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 #include <signal.h>
+#include <sys/socket.h>
 #include <net/if.h>
 #include <termios.h>
 #include <strings.h>
@@ -13,8 +14,13 @@
 #include <net/if_dl.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#if defined(__DragonFly__) || defined(__FreeBSD__)
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#else
 #include <net/if_ether.h>
 #include <net/ethertypes.h>
+#endif
 
 extern const char *__progname;
 
@@ -677,7 +683,6 @@ static void fork_pppd(void)
     *ap++ = "nodeflate";
     *ap++ = "nodetach";
     *ap++ = "noipdefault";
-    *ap++ = "noipx";
     *ap++ = "nopcomp";
     *ap++ = "nopersist";
     *ap++ = "nopredictor1";
@@ -701,17 +706,17 @@ static void send_frame_to_pppd(const voi
  const unsigned char *dp;
  unsigned short int fcs;
 
- static void addchar(unsigned char ch)
-  { switch (ch)
-     { case PPP_FLAG: case PPP_ESC: case 0x00 ... 0x1f: case 0x7f ... 0x9f:
-	  *sp++ = PPP_ESC;
-	  *sp++ = ch ^ PPP_MOD;
-	  break;
-       default:
-	  *sp++ = ch;
-	  break;
-     }
-    fcs = PPP_FCSCHAR(fcs,ch);
+#define addchar(ch) \
+  { switch (ch) \
+     { case PPP_FLAG: case PPP_ESC: case 0x00 ... 0x1f: case 0x7f ... 0x9f: \
+	  *sp++ = PPP_ESC; \
+	  *sp++ = ch ^ PPP_MOD; \
+	  break; \
+       default: \
+	  *sp++ = ch; \
+	  break; \
+     } \
+    fcs = PPP_FCSCHAR(fcs,ch); \
   }
 
  sp = &stuffup[0];