openvpn/openvpn.patch

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 666
0c12a9c824a0
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 Index: tun.c
     2 diff -Nau tun.c.orig tun.c
     3 --- tun.c.orig	2011-04-06 18:05:52.000000000 +0200
     4 +++ tun.c	2011-04-30 10:22:38.000000000 +0200
     5 @@ -1391,7 +1391,8 @@
     6  #elif defined(TARGET_SOLARIS)
     8  #ifndef TUNNEWPPA
     9 -#error I need the symbol TUNNEWPPA from net/if_tun.h
    10 +#warning I usually need the symbol TUNNEWPPA from net/if_tun.h -- using a shameless local copy taken from TUN 1.1
    11 +#define TUNNEWPPA   (('T'<<16) | 0x0001)
    12  #endif
    14  void
    16 -----------------------------------------------------------------------
    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.
    24 - MSvB 2012
    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);
    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);
    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
    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();
    59  #ifdef WIN32
    60 @@ -665,6 +672,7 @@
    61    close_syslog ();
    63  #ifdef ENABLE_PLUGIN
    64 +  if (status == OPENVPN_EXIT_STATUS_ERROR)
    65    plugin_abort ();
    66  #endif

mercurial