summaryrefslogtreecommitdiff
path: root/debian/patches/kfreebsd_support.patch
blob: 4445e0d69307d30e73aeaf054c82e16f66b54c81 (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Description: Improve kFreeBSD support
Author: Gonéri Le Bouder <goneri@rulezlan.org>
Bug-Debian: http://bugs.debian.org/626062
Index: openvpn/src/openvpn/route.c
===================================================================
--- openvpn.orig/src/openvpn/route.c	2017-06-22 13:17:05.754630908 +0200
+++ openvpn/src/openvpn/route.c	2017-06-22 13:17:05.750630880 +0200
@@ -1689,7 +1689,7 @@
     argv_msg(D_ROUTE, &argv);
     status = openvpn_execve_check(&argv, es, 0, "ERROR: Solaris route add command failed");
 
-#elif defined(TARGET_FREEBSD)
+#elif defined(TARGET_FREEBSD) || defined(__FreeBSD_kernel__)
 
     argv_printf(&argv, "%s add",
                 ROUTE_PATH);
@@ -1875,7 +1875,7 @@
     network = print_in6_addr( r6->network, 0, &gc);
     gateway = print_in6_addr( r6->gateway, 0, &gc);
 
-#if defined(TARGET_DARWIN)    \
+#if defined(TARGET_DARWIN) || defined(__FreeBSD_kernel__)    \
     || defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)    \
     || defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)
 
@@ -2043,7 +2043,7 @@
     argv_msg(D_ROUTE, &argv);
     status = openvpn_execve_check(&argv, es, 0, "ERROR: Solaris route add -inet6 command failed");
 
-#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)
+#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY) || defined(__FreeBSD_kernel__)
 
     argv_printf(&argv, "%s add -inet6 %s/%d",
                 ROUTE_PATH,
@@ -2227,7 +2227,7 @@
     argv_msg(D_ROUTE, &argv);
     openvpn_execve_check(&argv, es, 0, "ERROR: Solaris route delete command failed");
 
-#elif defined(TARGET_FREEBSD)
+#elif defined(TARGET_FREEBSD) || defined(__FreeBSD_kernel__)
 
     argv_printf(&argv, "%s delete -net %s %s %s",
                 ROUTE_PATH,
@@ -2334,7 +2334,7 @@
     network = print_in6_addr( r6->network, 0, &gc);
     gateway = print_in6_addr( r6->gateway, 0, &gc);
 
-#if defined(TARGET_DARWIN)    \
+#if defined(TARGET_DARWIN) || defined(__FreeBSD_kernel__)    \
     || defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)    \
     || defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)
 
@@ -2469,7 +2469,7 @@
     argv_msg(D_ROUTE, &argv);
     openvpn_execve_check(&argv, es, 0, "ERROR: Solaris route delete -inet6 command failed");
 
-#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)
+#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY) || defined(__FreeBSD_kernel__)
 
     argv_printf(&argv, "%s delete -inet6 %s/%d",
                 ROUTE_PATH,
@@ -3514,7 +3514,8 @@
 
 #elif defined(TARGET_DARWIN) || defined(TARGET_SOLARIS)    \
     || defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)    \
-    || defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)
+    || defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)    \
+    || defined(__FreeBSD_kernel__)
 
 #include <sys/types.h>
 #include <sys/socket.h>
Index: openvpn/src/openvpn/tun.c
===================================================================
--- openvpn.orig/src/openvpn/tun.c	2017-06-22 13:17:05.754630908 +0200
+++ openvpn/src/openvpn/tun.c	2017-06-22 13:17:05.750630880 +0200
@@ -843,7 +843,7 @@
 #endif /* if defined(_WIN32) || defined(TARGET_DARWIN) || defined(TARGET_NETBSD) || defined(TARGET_OPENBSD) */
 
 #if defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)  \
-    || defined(TARGET_OPENBSD)
+    || defined(TARGET_OPENBSD) || defined(__FreeBSD_kernel__)
 /* we can't use true subnet mode on tun on all platforms, as that
  * conflicts with IPv6 (wants to use ND then, which we don't do),
  * but the OSes want "a remote address that is different from ours"
@@ -1412,7 +1412,7 @@
             add_route_connected_v6_net(tt, es);
         }
 
-#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)
+#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY) || defined(__FreeBSD_kernel__)
 
         in_addr_t remote_end;           /* for "virtual" subnet topology */
 
@@ -2770,7 +2770,7 @@
     }
 }
 
-#elif defined(TARGET_FREEBSD)
+#elif defined(TARGET_FREEBSD)||defined(__FreeBSD_kernel__)
 
 static inline int
 freebsd_modify_read_write_return(int len)
Index: openvpn/src/openvpn/lladdr.c
===================================================================
--- openvpn.orig/src/openvpn/lladdr.c	2017-06-22 13:17:05.754630908 +0200
+++ openvpn/src/openvpn/lladdr.c	2017-06-22 13:17:05.750630880 +0200
@@ -50,7 +50,7 @@
                 "%s %s lladdr %s",
                 IFCONFIG_PATH,
                 ifname, lladdr);
-#elif defined(TARGET_FREEBSD)
+#elif defined(TARGET_FREEBSD) || defined(__FreeBSD_kernel__)
     argv_printf(&argv,
                 "%s %s ether %s",
                 IFCONFIG_PATH,
Index: openvpn/src/openvpn/syshead.h
===================================================================
--- openvpn.orig/src/openvpn/syshead.h	2017-06-22 13:17:05.754630908 +0200
+++ openvpn/src/openvpn/syshead.h	2017-06-22 13:17:05.750630880 +0200
@@ -297,7 +297,7 @@
 
 #endif /* TARGET_OPENBSD */
 
-#ifdef TARGET_FREEBSD
+#if defined(TARGET_FREEBSD) || defined(__FreeBSD_kernel__)
 
 #ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
Index: openvpn/src/openvpn/ssl.c
===================================================================
--- openvpn.orig/src/openvpn/ssl.c	2017-06-22 13:17:05.754630908 +0200
+++ openvpn/src/openvpn/ssl.c	2017-06-22 13:17:05.750630880 +0200
@@ -2269,7 +2269,7 @@
         buf_printf(&out, "IV_PLAT=mac\n");
 #elif defined(TARGET_NETBSD)
         buf_printf(&out, "IV_PLAT=netbsd\n");
-#elif defined(TARGET_FREEBSD)
+#elif defined(TARGET_FREEBSD) || defined(__FreeBSD_kernel__)
         buf_printf(&out, "IV_PLAT=freebsd\n");
 #elif defined(TARGET_ANDROID)
         buf_printf(&out, "IV_PLAT=android\n");