Your message dated Tue, 23 Mar 2010 10:32:45 +0000
with message-id <e1nu1ph-0007ub...@ries.debian.org>
and subject line Bug#517299: fixed in klibido 0.2.5-7
has caused the Debian Bug report #517299,
regarding klibido: needs 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 ow...@bugs.debian.org
immediately.)


-- 
517299: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517299
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: klibido
Version: 0.2.5-6
Severity: wishlist
Tags: patch

klibido lacks support for IPv6.

The attached patch adds a name lookup for an IPv6 address if no 
IPv4 address is found.

Since the protocol autodetection of QSocketDevice does not work in 
this scenario, we need to recreate the socket with specified protocol
(and save the IPv6 state for the thread in case of reconnects).

Regards,

Martin
--- klibido-0.2.5.orig/src/nntpthreadsocket.cpp
+++ klibido-0.2.5/src/nntpthreadsocket.cpp
@@ -26,6 +26,7 @@
 #include <assert.h>
 #include <netdb.h>
 #include <sys/poll.h>
+#include <arpa/inet.h>
 #include "queueparts.h"
 
 
@@ -241,24 +242,39 @@
 			}
 		ha.setAddress(addrList[0]);
 	*/
+	QString s;
+	char tempstr[64];
 	hostent *he=gethostbyname(nHost->hostName );
 	if (!he) {
-		qDebug("Cannot resolve hostname");
-		errorString="Cannot resolve " + nHost->hostName;
-		error=NntpThreadSocket::Comm_Err;
-		reset();
-		return false;
-	}
-	QString address=QString::number( (unsigned char) he->h_addr[0]);
-	QString s;
-	
-	for (int i = 1; i < he->h_length; i++) {
-		address+='.' + QString::number( (unsigned char) he->h_addr[i]);
+		// possibly IPV6
+		he = gethostbyname2(nHost->hostName, AF_INET6);
+		if (he) {
+			// IPV6 lookup successful
+			
+			// extra v6 socket (assigning v6 address to a standard socket leads to errors)
+			// not needed for reconnects
+			if ( false == useIPv6 ) {
+				kes->close();
+				delete kes;
+				kes = new QSocketDevice(QSocketDevice::Stream, QSocketDevice::IPv6, 0);
+				useIPv6 = true;
+			}
+
+			inet_ntop(AF_INET6, he->h_addr, tempstr, 64);
+			ha.setAddress(tempstr);
+		} else {
+			qDebug("Cannot resolve hostname");
+			errorString="Cannot resolve " + nHost->hostName;
+			error=NntpThreadSocket::Comm_Err;
+			reset();
+			return false;
 		}
-	
-// 	qDebug("Address: %s", (const char *) address);
-	ha.setAddress(address);
-	
+	} else {
+		// IPv4
+		inet_ntop(AF_INET, he->h_addr, tempstr, 64);
+		ha.setAddress(tempstr);
+	}
+//	qDebug("Address: %s", ha.toString().latin1());	
 	/*
 	//Debug!--------------------
 	qDebug("Connecting");
@@ -363,7 +379,11 @@
 			error=NntpThreadSocket::Comm_Err;
 			kes->close();
 			delete kes;
-			kes = new QSocketDevice(QSocketDevice::Stream);
+			if ( useIPv6 ) {
+				kes = new QSocketDevice(QSocketDevice::Stream, QSocketDevice::IPv6, 0);
+			} else {
+				kes = new QSocketDevice(QSocketDevice::Stream);
+			}
 			kes->setBlocking(true);
 			isLoggedIn=false;
 			watermark=buffer;
@@ -382,7 +402,11 @@
             qDebug("Bad response to the \"user\" cmd");
 			kes->close();
 			delete kes;
-			kes = new QSocketDevice(QSocketDevice::Stream);
+			if ( useIPv6 ) {
+				kes = new QSocketDevice(QSocketDevice::Stream, QSocketDevice::IPv6, 0);
+			} else {
+				kes = new QSocketDevice(QSocketDevice::Stream);
+			}
 			kes->setBlocking(true);
 			isLoggedIn=false;
 			watermark=buffer;
@@ -1778,7 +1802,7 @@
 	cancel=false;
 	pause=false;
 	status=Ready;
-	
+	useIPv6 = false;
 	
 	lineBufSize=1000;
     line=new char[lineBufSize];
@@ -2234,7 +2266,11 @@
 {
 	kes->close();
 	delete kes;
-	kes = new QSocketDevice(QSocketDevice::Stream);
+	if ( useIPv6 ) {
+		kes = new QSocketDevice(QSocketDevice::Stream, QSocketDevice::IPv6, 0);
+	} else {
+		kes = new QSocketDevice(QSocketDevice::Stream);
+	}
 	isLoggedIn=false;
 // 	*status=NntpThreadSocket::Ready;
 	watermark=buffer; //buffer emptyied :)
--- klibido-0.2.5.orig/src/nntpthreadsocket.h
+++ klibido-0.2.5/src/nntpthreadsocket.h
@@ -238,6 +238,7 @@
 		void setHost(NntpHost *nh);
 		bool m_sendCmd( QString& cmd, int response );
 		QTime prevTime, currentTime;
+		bool useIPv6;
 		
 		
 	public:
@@ -257,10 +258,6 @@
 		void tPause();
 		void tResume();
 		void tStart();
-		
-		
-		
-	
 };
 
 

--- End Message ---
--- Begin Message ---
Source: klibido
Source-Version: 0.2.5-7

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

klibido_0.2.5-7.debian.tar.gz
  to main/k/klibido/klibido_0.2.5-7.debian.tar.gz
klibido_0.2.5-7.dsc
  to main/k/klibido/klibido_0.2.5-7.dsc
klibido_0.2.5-7_amd64.deb
  to main/k/klibido/klibido_0.2.5-7_amd64.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 517...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fathi Boudra <f...@debian.org> (supplier of updated klibido 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 ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 23 Mar 2010 10:25:32 +0100
Source: klibido
Binary: klibido
Architecture: source amd64
Version: 0.2.5-7
Distribution: unstable
Urgency: low
Maintainer: Debian KDE Extras Team <pkg-kde-extras@lists.alioth.debian.org>
Changed-By: Fathi Boudra <f...@debian.org>
Description: 
 klibido    - usenet binary grabber for KDE
Closes: 513919 517299
Changes: 
 klibido (0.2.5-7) unstable; urgency=low
 .
   * Add 18_ipv6.diff patch: it adds a name lookup for an IPv6 address
     if no IPv4 address is found. Thanks to Martin Kotzan. (Closes: #517299)
   * Switch to dpkg-source 3.0 (quilt) format.
   * Update debian/control:
     - Update build dependencies (debhelper, automake1.9 and libtool).
       (Closes: 513919)
     - Bump Standards-Version to 3.8.4 (no changes needed).
   * Merge changes from ubuntu:
     - Escape $1 in klibidoload to handle files with Spaces correctly
       (LP: #246350)
     - In debian rules remove applnk/ instead of just applnk/Utilities/
     - Add final new line to debian/newzleech.desktop
     - Added patch 10_autoconf.patch:
       - make it possible to run buildprep with modern autotools
     - Rewrote 16_nzb_arg.patch:
       - make nzb file download "dcopable", and klibido a kuniqueapplication
     - Removed binsearch.desktop, Added newzleech.desktop:
       - newzleech works much better
     - Added klibidoload script to start klibido and use dcop call for nzb
       if needed
     - Fixed 12_fix_desktop_file.patch:
       - uses klibidoload startup script and associate with x-nzb mimetype
Checksums-Sha1: 
 e16e9a3f74b1de616c4a808c572b8f2fdaa241c7 1328 klibido_0.2.5-7.dsc
 174719b70957e1c98c4263266996439311e7aabd 11325 klibido_0.2.5-7.debian.tar.gz
 95351d37c95f2097b737e0807cfcd02cd80c14e8 429798 klibido_0.2.5-7_amd64.deb
Checksums-Sha256: 
 6c8ae0046fcbef4c7d414b5a1c1aedf004437cf74f660e066b7f9f5b6b857b51 1328 
klibido_0.2.5-7.dsc
 83b0a54643f8fd4896a90172ce27abf8f3f5d0eb467ae6ff099492539cef5e16 11325 
klibido_0.2.5-7.debian.tar.gz
 4673c32b711abb1a91d8cd45a06d9a01416dfaa9b8743e00218f1e954dc1dce0 429798 
klibido_0.2.5-7_amd64.deb
Files: 
 027dfbb64eef5f7afb17d8220c2a0470 1328 kde optional klibido_0.2.5-7.dsc
 189ffcd2f86181f57ba97dc4b6e187b2 11325 kde optional 
klibido_0.2.5-7.debian.tar.gz
 429c1066b93ea36006ee0b166bb62691 429798 kde optional klibido_0.2.5-7_amd64.deb

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

iJwEAQECAAYFAkuolngACgkQjPU19mqlcvc1mQQAt9uABqk0vRpFHIW+MokcjyOn
MJ+ykESS2d8iy2xZe13IwQfwZRBWsoApUp6I4ugUVyVJ6K/PPA8EiCdPeHtmJTZM
x7FYfK2DRvoxHojIo/pZaJl7xcNRIfFM52oO0eazxqe3YvqWya45aO2kUiXVKR3p
tKEirr2VjND0obL5968=
=KNvK
-----END PGP SIGNATURE-----



--- End Message ---
_______________________________________________
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras

Reply via email to