1 Index: tun.c |
1 Index: tun.c |
|
2 diff -Nau tun.c.orig tun.c |
2 --- tun.c.orig 2011-04-06 18:05:52.000000000 +0200 |
3 --- tun.c.orig 2011-04-06 18:05:52.000000000 +0200 |
3 +++ tun.c 2011-04-30 10:22:38.000000000 +0200 |
4 +++ tun.c 2011-04-30 10:22:38.000000000 +0200 |
4 @@ -1400,7 +1400,8 @@ |
5 @@ -1391,7 +1391,8 @@ |
5 #elif defined(TARGET_SOLARIS) |
6 #elif defined(TARGET_SOLARIS) |
6 |
7 |
7 #ifndef TUNNEWPPA |
8 #ifndef TUNNEWPPA |
8 -#error I need the symbol TUNNEWPPA from net/if_tun.h |
9 -#error I need the symbol TUNNEWPPA from net/if_tun.h |
9 +#warning I usually need the symbol TUNNEWPPA from net/if_tun.h -- using a shameless local copy taken from TUN 1.1 |
10 +#warning I usually need the symbol TUNNEWPPA from net/if_tun.h -- using a shameless local copy taken from TUN 1.1 |
10 +#define TUNNEWPPA (('T'<<16) | 0x0001) |
11 +#define TUNNEWPPA (('T'<<16) | 0x0001) |
11 #endif |
12 #endif |
12 |
13 |
13 void |
14 void |
|
15 |
|
16 ----------------------------------------------------------------------- |
|
17 |
|
18 It's a hack since unnumbered device drivers could contain digits in |
|
19 their name, but at least this corrects OpenVPN's false assumption that |
|
20 all TUN drivers in the world are named 'tun' by module and device node. |
|
21 In the worst case, this change attempts to attach to a unnumbered device |
|
22 node without appending a number which should fail. |
|
23 |
|
24 - MSvB 2012 |
|
25 |
|
26 Index: tun.c |
|
27 diff -Nau tun.c.orig tun.c |
|
28 --- tun.c.orig Fri Mar 2 19:28:20 2012 |
|
29 +++ tun.c Fri Mar 2 21:08:22 2012 |
|
30 @@ -1480,7 +1480,10 @@ |
|
31 tt->actual_name = (char *) malloc (32); |
|
32 check_malloc_return (tt->actual_name); |
|
33 |
|
34 - openvpn_snprintf (tt->actual_name, 32, "%s%d", dev_tuntap_type, ppa); |
|
35 + if (has_digit((unsigned char *)dev)) |
|
36 + openvpn_snprintf (tt->actual_name, 32, "%s", dev); |
|
37 + else |
|
38 + openvpn_snprintf (tt->actual_name, 32, "%s%d", dev, ppa); |
|
39 |
|
40 if (tt->type == DEV_TYPE_TAP) |
|
41 { |
|
42 Index: error.c |
|
43 diff -Nau error.c.orig error.c |
|
44 --- error.c.orig 2011-12-13 17:58:56.000000000 +0100 |
|
45 +++ error.c 2012-03-06 18:52:39.236992377 +0100 |
|
46 @@ -656,6 +656,13 @@ |
|
47 void plugin_abort (void); |
|
48 #endif |
|
49 |
|
50 + /* Ignored BUG https://community.openvpn.net/openvpn/ticket/53 |
|
51 + * This solves the problem of flawed release of important resources |
|
52 + * when OpenVPN daemonizes. Otherwise we see immediately after startup: |
|
53 + * Tue Mar 6 18:33:22 2012 Initialization Sequence Completed |
|
54 + * Tue Mar 6 18:33:36 2012 event_wait : Interrupted system call |
|
55 + * Tue Mar 6 18:33:36 2012 TCP/UDP: Closing socket */ |
|
56 + if (status == OPENVPN_EXIT_STATUS_ERROR) |
|
57 tun_abort(); |
|
58 |
|
59 #ifdef WIN32 |
|
60 @@ -665,6 +672,7 @@ |
|
61 close_syslog (); |
|
62 |
|
63 #ifdef ENABLE_PLUGIN |
|
64 + if (status == OPENVPN_EXIT_STATUS_ERROR) |
|
65 plugin_abort (); |
|
66 #endif |
|
67 |