tun/tun.patch

Sat, 03 Oct 2009 16:18:52 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Oct 2009 16:18:52 +0200
changeset 220
a6cd892638c1
child 667
9dacbd1d1aa2
permissions
-rw-r--r--

Update version, adjust corresponding buildconf, and correct logic.
1: Make minor corrections and improvements to scripts patch logic.
2: Upgrade to most recent stable release version 3.0.2.
3: Force selection of a single db backend, as multiple ones never
were supported (changing 'with_db<end>' identifiers accordingly.)
4: Unfortunately add gawk requirement although only partly needed.
5: Add openssl::with_threads requirement to solve strange and hard
to debug problems on Solaris leading to connection failures:

'host-dir JobId 0: Error: openssl.c:86 Connect failure: ERR=error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number'

and

'host-dir JobId 40: Fatal error: TLS negotiation failed with FD at "back1.host.com:9102"'

     1 Index: linux/2.2/tun.c
     2 --- linux/2.2/tun.c.orig	2006-10-10 14:45:00.338589000 +0200
     3 +++ linux/2.2/tun.c	2006-10-10 14:44:05.695404000 +0200
     4 @@ -178,10 +178,22 @@
     6     DBG( KERN_INFO "%s: tun_chr_poll\n", tun->name);
     8 +   /* Data written to the /dev/tunX device is immediately placed into a socket buffer, making it
     9 +    * available to networking code at the tunX interface.  Writes never block.
    10 +    * Likewise, data flows from the network stack, through the tunX interface and into the /dev/tun* device,
    11 +    * where it is queued, making it available for read().
    12 +    * Thus the character device /dev/tunX is:
    13 +    *   - readable if data was "transmitted" to the tunX interface and is now queued at the /dev/tunX device.
    14 +    *   - always writable.
    15 +    * Everything written here is equally true of taps.
    16 +    * The author made a mistake when implementing this routine; he forgot that the device is always writable.
    17 +    * -jeff stearns 22-Dec-2005
    18 +    */
    19 +
    20     poll_wait(file, &tun->read_wait, wait);
    22     if( skb_queue_len(&tun->txq) )
    23 -      return POLLIN | POLLRDNORM;
    24 +      return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM;
    26     return POLLOUT | POLLWRNORM;
    27  }
    28 Index: linux/2.4/tun.c
    29 --- linux/2.4/tun.c.orig	2006-10-10 14:41:57.910408000 +0200
    30 +++ linux/2.4/tun.c	2006-10-10 14:43:40.067700000 +0200
    31 @@ -176,9 +176,21 @@
    32  	DBG(KERN_INFO "%s: tun_chr_poll\n", tun->name);
    34  	poll_wait(file, &tun->read_wait, wait);
    35 +
    36 +	/* Data written to the /dev/tunX device is immediately placed into a socket buffer, making it
    37 +	 * available to networking code at the tunX interface.  Writes never block.
    38 +	 * Likewise, data flows from the network stack, through the tunX interface and into the /dev/tun* device,
    39 +	 * where it is queued, making it available for read().
    40 +	 * Thus the character device /dev/tunX is:
    41 +	 *   - readable if data was "transmitted" to the tunX interface and is now queued at the /dev/tunX device.
    42 +	 *   - always writable.
    43 +	 * Everything written here is equally true of taps.
    44 +	 * The author made a mistake when implementing this routine; he forgot that the device is always writable.
    45 +	 * -jeff stearns 22-Dec-2005
    46 +	 */
    48  	if (skb_queue_len(&tun->txq))
    49 -		return POLLIN | POLLRDNORM;
    50 +		return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM;
    52  	return POLLOUT | POLLWRNORM;
    53  }

mercurial