Incorporate new tun name logic and correct OPENVPN_EXIT_STATUS_ERROR bug.

Fri, 07 Sep 2012 19:09:56 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:09:56 +0200
changeset 668
4b4e887677a9
parent 667
9dacbd1d1aa2
child 669
dc764d5d565d

Incorporate new tun name logic and correct OPENVPN_EXIT_STATUS_ERROR bug.

openvpn/openvpn.patch file | annotate | diff | comparison | revisions
openvpn/openvpn.spec file | annotate | diff | comparison | revisions
     1.1 --- a/openvpn/openvpn.patch	Fri Sep 07 19:08:07 2012 +0200
     1.2 +++ b/openvpn/openvpn.patch	Fri Sep 07 19:09:56 2012 +0200
     1.3 @@ -1,7 +1,8 @@
     1.4  Index: tun.c
     1.5 +diff -Nau tun.c.orig tun.c
     1.6  --- tun.c.orig	2011-04-06 18:05:52.000000000 +0200
     1.7  +++ tun.c	2011-04-30 10:22:38.000000000 +0200
     1.8 -@@ -1400,7 +1400,8 @@
     1.9 +@@ -1391,7 +1391,8 @@
    1.10   #elif defined(TARGET_SOLARIS)
    1.11   
    1.12   #ifndef TUNNEWPPA
    1.13 @@ -11,3 +12,56 @@
    1.14   #endif
    1.15   
    1.16   void
    1.17 +
    1.18 +-----------------------------------------------------------------------
    1.19 +
    1.20 +It's a hack since unnumbered device drivers could contain digits in
    1.21 +their name, but at least this corrects OpenVPN's false assumption that
    1.22 +all TUN drivers in the world are named 'tun' by module and device node.
    1.23 +In the worst case, this change attempts to attach to a unnumbered device
    1.24 +node without appending a number which should fail.
    1.25 +
    1.26 +- MSvB 2012
    1.27 +
    1.28 +Index: tun.c
    1.29 +diff -Nau tun.c.orig tun.c
    1.30 +--- tun.c.orig	Fri Mar  2 19:28:20 2012
    1.31 ++++ tun.c	Fri Mar  2 21:08:22 2012
    1.32 +@@ -1480,7 +1480,10 @@
    1.33 +   tt->actual_name = (char *) malloc (32);
    1.34 +   check_malloc_return (tt->actual_name);
    1.35 + 
    1.36 +-  openvpn_snprintf (tt->actual_name, 32, "%s%d", dev_tuntap_type, ppa);
    1.37 ++  if (has_digit((unsigned char *)dev))
    1.38 ++    openvpn_snprintf (tt->actual_name, 32, "%s", dev);
    1.39 ++  else
    1.40 ++    openvpn_snprintf (tt->actual_name, 32, "%s%d", dev, ppa);
    1.41 + 
    1.42 +   if (tt->type == DEV_TYPE_TAP)
    1.43 +     {
    1.44 +Index: error.c
    1.45 +diff -Nau error.c.orig error.c
    1.46 +--- error.c.orig	2011-12-13 17:58:56.000000000 +0100
    1.47 ++++ error.c	2012-03-06 18:52:39.236992377 +0100
    1.48 +@@ -656,6 +656,13 @@
    1.49 +   void plugin_abort (void);
    1.50 + #endif
    1.51 + 
    1.52 ++  /* Ignored BUG https://community.openvpn.net/openvpn/ticket/53
    1.53 ++   * This solves the problem of flawed release of important resources
    1.54 ++   * when OpenVPN daemonizes. Otherwise we see immediately after startup:
    1.55 ++   * Tue Mar  6 18:33:22 2012 Initialization Sequence Completed
    1.56 ++   * Tue Mar  6 18:33:36 2012 event_wait : Interrupted system call
    1.57 ++   * Tue Mar  6 18:33:36 2012 TCP/UDP: Closing socket */
    1.58 ++  if (status == OPENVPN_EXIT_STATUS_ERROR)
    1.59 +   tun_abort();
    1.60 + 
    1.61 + #ifdef WIN32
    1.62 +@@ -665,6 +672,7 @@
    1.63 +   close_syslog ();
    1.64 + 
    1.65 + #ifdef ENABLE_PLUGIN
    1.66 ++  if (status == OPENVPN_EXIT_STATUS_ERROR)
    1.67 +   plugin_abort ();
    1.68 + #endif
    1.69 + 
     2.1 --- a/openvpn/openvpn.spec	Fri Sep 07 19:08:07 2012 +0200
     2.2 +++ b/openvpn/openvpn.spec	Fri Sep 07 19:09:56 2012 +0200
     2.3 @@ -36,7 +36,7 @@
     2.4  Group:        Network
     2.5  License:      GPL
     2.6  Version:      %{V_opkg}
     2.7 -Release:      20111223
     2.8 +Release:      20120800
     2.9  
    2.10  #   package options
    2.11  %option       with_fsl  yes

mercurial