s2s no longer allows IPv4 outgoing connections when bound to ::
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Jabberd |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hi -
It looks like between jabberd 2.2.5 and 2.2.6 there was a change to s2s/main.c that checks the origin_ip for outgoing connections. Unfortunately, it seems that this has broken s2s's ability to bind to :: (via the ip tags in s2s.xml) and be able to connect to IPv4 addresses (via mapping from the kernel). One must now set the IP to 0.0.0.0 to connect to any IPv4 XMPP servers, but this prevents IPv6 connections. When :: is specified, the error in the logs is the following:
May 10 20:14:17 dax jabberd/s2s[98801]: dns lookup for gmail.com returned 2 results (ttl 1800)
May 10 20:14:17 dax jabberd/s2s[98801]: [-1] [209.85.163.125, port=5269] mio_connect error: Invalid argument (22)
May 10 20:14:17 dax jabberd/s2s[98801]: [-1] [209.85.201.125, port=5269] mio_connect error: Invalid argument (22)
The origin tags are commented out in my s2s.xml. I have removed the following on version 2.2.8, and s2s works correctly when bound to ::, once again:
--- main2.2.6.c 2009-02-09 07:15:57.000000000 -0500
+++ main2.2.5.c 2008-07-15 06:30:30.000000000 -0400
@@ -115,15 +115,7 @@
s2s-
- /*
- * If no origin IP is specified, use local IP as the originating one:
- * it makes most sense, at least for SSL'ized connections.
- */
s2s->local_ip = config_
- s2s->origin_ip = config_
- if(s2s->origin_ip == NULL && s2s->local_ip != NULL)
- s2s->origin_ip = s2s->local_ip;
-
if(
I'm not too versed in the rest of the code, but I don't believe this is expected behavior. Here is some information about my platform:
FreeBSD 7.0-RELEASE-p9 amd64 (with net.inet6.
jabberd-2.2.8 (FreeBSD port)
Host is dual-stacked with both IPv4 and IPv6 connectivity.
Please let me know if I'm completely off-base with this, or if you need more information.
Thanks!
- Mark
Please try the following diff instead.