Your message dated Tue, 15 Jun 2010 16:03:08 +0000
with message-id <[email protected]>
and subject line Bug#581552: fixed in vtun 3.0.2-2.1
has caused the Debian Bug report #581552,
regarding vtun: want ipv6 support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
581552: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581552
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: vtun
Version: 3.0.2-2
Severity: grave
Tags: patch

I have found the package vtun_3.0.2-2 to be completely broken
on any system running Debian testing when IPv4 as well as
IPv6 are in active service simultaneously.

The reason is that, as of 'testing', the function gethostbyname()
from Glibc returns an IPv6 address as first object. This is not
detected by 'vtund', whence the client tries to send even the
first query to a fully corrupt address.

The attached patch resolves this behaviour completly, and restores
full functionality to the indicated systems. This has been tested
on architectures i386 and amd64.

Let me in passing mention that this observation was made in the
course of migrating vtun into supporting IPv6 transports. The
completion of this undertaking is not too distant into the future,
but the problem addressed in the present bug report can easily mended
without any IPv6 support whatsoever.

Additionally, the maintainer of this package must resolve the issue
of mixed lisenses, GPL and OpenSSL, in this software. 


Best regards,

Mats Erik Andersson, fil. dr

2459 41E9 C420 3F6D F68B  2E88 F768 4541 F25B 5D41

Subscribes to: debian-mentors, debian-devel-games, debian-perl,
              debian-ipv6, debian-qa
Description: Replace gethostbyname() with getaddrinfo().
 In recent versions of glibc, a call to gethostbyname()
 will be default return an IPv6 reference as first entry.
 This completely breaks communication between the vtund
 server instance and the vtund client instance.
 .
 The solution to this clash is to migrate the code in
 'netlib.c' to use getaddrinfo(), since this function
 can easily be configured to onöy return IPv4 addresses.
Author: Mats Erik Andersson <[email protected]>
Forwarded: no
Last-Update: 2010-05-13
--- vtun-3.0.2.debian/netlib.c
+++ vtun-3.0.2/netlib.c
@@ -229,21 +229,23 @@ int local_addr(struct sockaddr_in *addr,
 
 int server_addr(struct sockaddr_in *addr, struct vtun_host *host)
 {
-     struct hostent * hent;
+     struct addrinfo hints, *aiptr;
 
      memset(addr,0,sizeof(struct sockaddr_in));
-     addr->sin_family = AF_INET;
-     addr->sin_port = htons(vtun.bind_addr.port);
+     memset(&hints, '\0', sizeof(hints));
+     hints.ai_family = AF_INET;
 
      /* Lookup server's IP address.
       * We do it on every reconnect because server's IP 
       * address can be dynamic.
       */
-     if( !(hent = gethostbyname(vtun.svr_name)) ){
+     if( getaddrinfo(vtun.svr_name, NULL, &hints, &aiptr) ){
         vtun_syslog(LOG_ERR, "Can't resolv server address: %s", vtun.svr_name);
         return -1;
      }
-     addr->sin_addr.s_addr = *(unsigned long *)hent->h_addr; 
+     memcpy(addr, aiptr->ai_addr, aiptr->ai_addrlen);
+     addr->sin_port = htons(vtun.bind_addr.port);
+     freeaddrinfo(aiptr);
 
      host->sopt.raddr = strdup(inet_ntoa(addr->sin_addr));
      host->sopt.rport = vtun.bind_addr.port;
@@ -254,8 +256,11 @@ int server_addr(struct sockaddr_in *addr
 /* Set address by interface name, ip address or hostname */
 int generic_addr(struct sockaddr_in *addr, struct vtun_addr *vaddr)
 {
-     struct hostent *hent;
+     struct addrinfo hints, *aiptr;
+
      memset(addr, 0, sizeof(struct sockaddr_in));
+     memset(&hints, '\0', sizeof(hints));
+     hints.ai_family = AF_INET;
   
      addr->sin_family = AF_INET;
   
@@ -270,13 +275,14 @@ int generic_addr(struct sockaddr_in *add
 	 }
            break;
         case VTUN_ADDR_NAME:
-	 if (!(hent = gethostbyname(vaddr->name))) {
+	 if( getaddrinfo(vaddr->name, NULL, &hints, &aiptr) ){
 	    vtun_syslog(LOG_ERR,
 	                "Can't resolv local address %s",
 	                vaddr->name);
 	    return -1;
            }
-	 addr->sin_addr.s_addr = *(unsigned long *) hent->h_addr;
+	 memcpy(addr, aiptr->ai_addr, aiptr->ai_addrlen);
+	 freeaddrinfo(aiptr);
            break;
         default:
            addr->sin_addr.s_addr = INADDR_ANY;

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: vtun
Source-Version: 3.0.2-2.1

We believe that the bug you reported is fixed in the latest version of
vtun, which is due to be installed in the Debian FTP archive:

vtun_3.0.2-2.1.diff.gz
  to main/v/vtun/vtun_3.0.2-2.1.diff.gz
vtun_3.0.2-2.1.dsc
  to main/v/vtun/vtun_3.0.2-2.1.dsc
vtun_3.0.2-2.1_i386.deb
  to main/v/vtun/vtun_3.0.2-2.1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
gregor herrmann <[email protected]> (supplier of updated vtun package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 13 Jun 2010 17:30:52 +0200
Source: vtun
Binary: vtun
Architecture: source i386
Version: 3.0.2-2.1
Distribution: unstable
Urgency: low
Maintainer: Martín Ferrari <[email protected]>
Changed-By: gregor herrmann <[email protected]>
Description: 
 vtun       - virtual tunnel over TCP/IP networks
Closes: 581552
Changes: 
 vtun (3.0.2-2.1) unstable; urgency=low
 .
   * Non-maintainer upload.
   * Fix "vtun is broken on 'testing' when IPv6 is configured": apply patch by
     Mats Erik Andersson as debian/patches/06-ipv6.patch (closes: #581552).
Checksums-Sha1: 
 ad2435790d35c272b743f390866a622ee36c011b 1746 vtun_3.0.2-2.1.dsc
 f15637efb92458d57c5dd3683b616e0e52ded474 21169 vtun_3.0.2-2.1.diff.gz
 6a01e792dc7b25b8d01f73600f812aa7dec78376 65622 vtun_3.0.2-2.1_i386.deb
Checksums-Sha256: 
 cde505f7f888547f5f304756e7c3feccd12e8a09b0d6058514d8069a5fc8b462 1746 
vtun_3.0.2-2.1.dsc
 3bec7baa7fb500ba153b3ab223ad79f392926f552782e4e5e7866c69a04f053c 21169 
vtun_3.0.2-2.1.diff.gz
 4931a6f0224d0ce376003706cd48f4b6d4743aa0d50770e257c5cece8cd8e952 65622 
vtun_3.0.2-2.1_i386.deb
Files: 
 0ae7322e8bec5fc47eb35a84f0b110ee 1746 net optional vtun_3.0.2-2.1.dsc
 2c51d2be3659cbf70b87700761db62ec 21169 net optional vtun_3.0.2-2.1.diff.gz
 18d985abe7b20a96d44cd1cc26e1b385 65622 net optional vtun_3.0.2-2.1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJMFPsiAAoJELs6aAGGSaoG9DAP/1f8uKTewvZ5NEkN5pR+3KT4
0F7ccQuUGKHVeMZk7pxcIg5JH2oQsMjICvFmAagrnXyqudMVOiaCTe+TnyhtECSl
F/R8546md9xNeOjWacUmFKmFWf/prLGKBmf+m2H1Mi+Neabr2Q37TDJVZ/wnKmuD
W2CdprMVmtugUzRjLm0ie5FmoorJeBJRzHlnZ5dSOWn/Z8b4barMtNaTI/96wzhQ
G7I2gThU8lEIgdtyaGdYmHVdBncnfZiSIPs0S11x+oPYUAo/KfESzUWr0sd5kiBL
z72+W/tUoQ7okl6xE6FLAA34SlN7FoOnGVx2Te+EGkVtej284XbayNZZAg2afX5i
/jGEpE244Nugf1RzYhjzQ968yNPHgYtogv/Lu9jwVYxU4vVBye2oQSlgYva60D7+
kMJuh4cHZOAi7Dw5ihmXnE0uVMvUX+nKdvlmM7GQZBfHGbUvnUbHpUvRUXOrjqjl
rVQJtf2MkJ17icqFYM/99jZfAwSS++OMEpPOQRTFoefnnG3mgK7hFNw+F3Tvi16+
LMgCgXderb+ZlOXCskoD9/B4yi3mSHCZbSSUnDPGfE3SsN3YH5tYr6x2lB1ydRwD
RnLJNNqgQpocGhdb6eRenb//WRR8I029wpfx2upDTGUTS5EM3wlvB5vFAPMYHRgJ
sChsWuEzuWB3ojCCRSz3
=2cv+
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to