[kde-solaris] KServerSocket and IPV6 on Solaris

Karsten Künne kuenne at rentec.com
Fri Jan 14 20:06:08 CET 2005

As I was debugging why filetransfers aren't working via MSN in kopete I 
stumbled over the KServerSocket class and it's behavior on Solaris. The MSN 
filetransfer implementation uses it (and so far it's the only application I 
found which uses it) but on Solaris 9 at least the following happens. If you 
don't specify a nodename you want to listen on it always allocate a PF_INET6 
socket and then tries to bind to "::" (localhost or so in IPV6) which fails 
because we don't have IPV6 configured on the interface, then it tries to bind 
to "" which fails because it's an IPV6 socket and this is an IPV4 
address and last it tries to bind to "/tmp/<portnumber>" which also fails 
because it's not a UNIX domain socket. I don't know how to properly fix this 
for Solaris. As a workaround I changed msnfiletransfersocket.cpp in kopete to 
specify "" as nodename in the setAddress call but this obviously 
breaks IPV6 (which we don't care about). Maybe somebody has a better fix for 
this. And, no, setting "KDE_NO_IPV6" in the environment doesn't fix it (tried 

Following is the patch:

--- msnfiletransfersocket.cpp.orig      Thu Jan 13 18:23:29 2005
+++ msnfiletransfersocket.cpp   Fri Jan 14 14:02:15 2005
@@ -192,7 +192,7 @@
        m_server = new KServerSocket();

        QObject::connect( m_server, SIGNAL(readyAccept()), this,  
-       m_server->setAddress(QString::number(port));
+       m_server->setAddress("", QString::number(port));

        kdDebug(14140) << "MSNFileTransferSocket::listen: about to 
        bool listenResult = m_server->listen(1);

You don't sew with a fork, so I see no reason to eat with knitting
  -- Miss Piggy, on eating Chinese Food
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-solaris/attachments/20050114/e4510d67/attachment.pgp

More information about the kde-solaris mailing list