Modify

#644 closed enhancement (fixed)

Using IPv6 to connect into XMPP-server

Reported by: sami@… Owned by: wilmer
Priority: normal Milestone:
Component: Jabber Version: 1.2.7
Keywords: IPv6, jabber, xmpp Cc:
IRC client+version: Client-independent Operating System: Linux
OS version/distro:

Description

I'd hope that I could connect into XMPP-server using IPv6. Maybe some setting or specifying somthing like "-6" in server addition.

And more generally maybe a some setting where Bitlbee would prefer IPv6 over IPv4 in generally connecting somewhere, changeable ofcourse :)

Attachments (2)

bitlbee-otr-ipv6.diff (3.2 KB) - added by wahjava@… at 2010-08-01T09:00:38Z.
BitlBee IPv6 support diff
patch-lib_proxy.c (4.0 KB) - added by Ashish SHUKLA <wahjava@…> at 2010-08-01T18:32:44Z.
BitlBee IPv6 support diff (updated)

Download all attachments as: .zip

Change History (8)

Changed at 2010-08-01T09:00:38Z by wahjava@…

Attachment: bitlbee-otr-ipv6.diff added

BitlBee IPv6 support diff

comment:1 Changed at 2010-08-01T09:00:54Z by anonymous

Hi everyone,

Attached is the diff which adds IPv6 support to BitlBee. when AAAA records are found. This code uses getaddrinfo function.

tcp        0      0 2001:470:19:151:9:44073 2001:6f8:900:906:::5222 EST             
tcp        0      0 ::ffff:172.18.33.:58651 ::ffff:174.129.226:5222 EST             
tcp        0      0 ::ffff:172.18.33.:54291 ::ffff:208.68.163.:5222 EST             
tcp        0      0 ::ffff:172.18.33.:33241 ::ffff:208.93.0.12:5222 EST             
tcp        0      0 ::ffff:172.18.33.:39723 ::ffff:72.14.203.1:5222 EST

The sockets are created of type AF_INET6 and IPv4 addresses are represented as IPv6 addresses of type IPv4-mapped addresses.

ATM, its only tested on GNU/Linux. I'll test with FreeBSD in a day or two.

www.swissjabber.ch offers free XMPP server hosted on IPv6 internet, in case you want to test \o/

comment:2 Changed at 2010-08-01T09:11:38Z by wahjava@…

For any comments or help please post here. Sorry posted last message as anonymous.

comment:3 Changed at 2010-08-01T18:31:59Z by Ashish SHUKLA <wahjava@…>

Please discard the previous diff.

The attached diff works for FreeBSD also. As long as global interface out option is not used this works great.

Changed at 2010-08-01T18:32:44Z by Ashish SHUKLA <wahjava@…>

Attachment: patch-lib_proxy.c added

BitlBee IPv6 support diff (updated)

comment:4 Changed at 2010-08-03T11:44:09Z by wilmer

Sweet! I'll merge this in a few days, want to take a closer look at the diff.

The ClientInterface detail is a bit unfortunate, may be nice to find a solution for that later. (A ClientInterface6 or something, maybe.)

comment:5 in reply to:  4 Changed at 2010-08-03T14:03:01Z by Ashish SHUKLA <wahjava@…>

Replying to wilmer:

Sweet! I'll merge this in a few days, want to take a closer look at the diff.

Thanks.

The ClientInterface detail is a bit unfortunate, may be nice to find a solution for that later. (A ClientInterface6 or something, maybe.)

BtW in FreeBSD, the IPv4 connections are created via AF_INET sockets, as opposed to AF_INET6 sockets for all type of connections in GNU/Linux, as the getaddrinfo() implementation in libc of FreeBSD doesn't return IPv4 mapped addresses.

comment:6 Changed at 2010-08-07T14:57:28Z by wilmer

Resolution: fixed
Status: newclosed

Applied in changeset:devel,643.

The V4MAPPED stuff was causing troubles on my Linux machine as well so I just removed it. If at some point someone really wants a clientinterface-like thing for IPv6 we can add that later.

Stuff also got a lot simpler by just passing the port number to getaddrinfo(), it'll then generate a fully functional struct sockaddr already.

Thanks!

Modify Ticket

Action
as closed The owner will remain wilmer.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.