aboutsummaryrefslogtreecommitdiffstats
path: root/testing/vpnc/working.patch
blob: 52ec3975cc8bcda05270c24c8680ef5c93ebabbd (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
Author: Rien Maertens <maertensrien@gmail.com>
Description: Fixes VPNC not working. Patch taken and modified from OpenWRT.
URL: https://github.com/openwrt/packages/blob/master/net/vpnc/patches/100-musl-compat.patch
--- orig/config.c
+++ patched/config.c
@@ -26,7 +26,10 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
+#include <sys/ttydefaults.h>
+#include <sys/types.h>
 #include <sys/utsname.h>
+#include <sys/wait.h>

 #include <gcrypt.h>

--- orig/sysdep.c
+++ patched/sysdep.c
@@ -59,6 +59,10 @@
 #if defined(__DragonFly__)
 #include <net/tun/if_tun.h>
 #elif defined(__linux__)
+# if !defined(__GLIBC__) && !defined(__UCLIBC__)
+#  define _LINUX_IF_ETHER_H
+#  include <net/ethernet.h>
+# endif
 #include <linux/if_tun.h>
 #elif defined(__APPLE__)
 /* no header for tun */
--- orig/sysdep.h
+++ patched/sysdep.h
@@ -37,12 +37,14 @@
 int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);

 /***************************************************************************/
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__GLIBC__) || defined(__UCLIBC__)
 #include <error.h>
+#define HAVE_ERROR     1
+#endif

+#if defined(__linux__) || defined(__GLIBC__)
 #define HAVE_VASPRINTF 1
 #define HAVE_ASPRINTF  1
-#define HAVE_ERROR     1
 #define HAVE_GETLINE   1
 #define HAVE_UNSETENV  1
 #define HAVE_SETENV    1