# HG changeset patch # User Michael Schloh von Bennewitz # Date 1347037796 -7200 # Node ID 4b4e887677a9bd4fec96ea401d6b83997094b33b # Parent 9dacbd1d1aa27408926fd0fe8bbbfd16300468f6 Incorporate new tun name logic and correct OPENVPN_EXIT_STATUS_ERROR bug. diff -r 9dacbd1d1aa2 -r 4b4e887677a9 openvpn/openvpn.patch --- a/openvpn/openvpn.patch Fri Sep 07 19:08:07 2012 +0200 +++ b/openvpn/openvpn.patch Fri Sep 07 19:09:56 2012 +0200 @@ -1,7 +1,8 @@ Index: tun.c +diff -Nau tun.c.orig tun.c --- tun.c.orig 2011-04-06 18:05:52.000000000 +0200 +++ tun.c 2011-04-30 10:22:38.000000000 +0200 -@@ -1400,7 +1400,8 @@ +@@ -1391,7 +1391,8 @@ #elif defined(TARGET_SOLARIS) #ifndef TUNNEWPPA @@ -11,3 +12,56 @@ #endif void + +----------------------------------------------------------------------- + +It's a hack since unnumbered device drivers could contain digits in +their name, but at least this corrects OpenVPN's false assumption that +all TUN drivers in the world are named 'tun' by module and device node. +In the worst case, this change attempts to attach to a unnumbered device +node without appending a number which should fail. + +- MSvB 2012 + +Index: tun.c +diff -Nau tun.c.orig tun.c +--- tun.c.orig Fri Mar 2 19:28:20 2012 ++++ tun.c Fri Mar 2 21:08:22 2012 +@@ -1480,7 +1480,10 @@ + tt->actual_name = (char *) malloc (32); + check_malloc_return (tt->actual_name); + +- openvpn_snprintf (tt->actual_name, 32, "%s%d", dev_tuntap_type, ppa); ++ if (has_digit((unsigned char *)dev)) ++ openvpn_snprintf (tt->actual_name, 32, "%s", dev); ++ else ++ openvpn_snprintf (tt->actual_name, 32, "%s%d", dev, ppa); + + if (tt->type == DEV_TYPE_TAP) + { +Index: error.c +diff -Nau error.c.orig error.c +--- error.c.orig 2011-12-13 17:58:56.000000000 +0100 ++++ error.c 2012-03-06 18:52:39.236992377 +0100 +@@ -656,6 +656,13 @@ + void plugin_abort (void); + #endif + ++ /* Ignored BUG https://community.openvpn.net/openvpn/ticket/53 ++ * This solves the problem of flawed release of important resources ++ * when OpenVPN daemonizes. Otherwise we see immediately after startup: ++ * Tue Mar 6 18:33:22 2012 Initialization Sequence Completed ++ * Tue Mar 6 18:33:36 2012 event_wait : Interrupted system call ++ * Tue Mar 6 18:33:36 2012 TCP/UDP: Closing socket */ ++ if (status == OPENVPN_EXIT_STATUS_ERROR) + tun_abort(); + + #ifdef WIN32 +@@ -665,6 +672,7 @@ + close_syslog (); + + #ifdef ENABLE_PLUGIN ++ if (status == OPENVPN_EXIT_STATUS_ERROR) + plugin_abort (); + #endif + diff -r 9dacbd1d1aa2 -r 4b4e887677a9 openvpn/openvpn.spec --- a/openvpn/openvpn.spec Fri Sep 07 19:08:07 2012 +0200 +++ b/openvpn/openvpn.spec Fri Sep 07 19:09:56 2012 +0200 @@ -36,7 +36,7 @@ Group: Network License: GPL Version: %{V_opkg} -Release: 20111223 +Release: 20120800 # package options %option with_fsl yes