ports/123253: fix IPv6 support and enable dual stack support in jabber14
Ruben van Staveren
ruben at verweg.com
Wed Apr 30 10:20:02 UTC 2008
>Number: 123253
>Category: ports
>Synopsis: fix IPv6 support and enable dual stack support in jabber14
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Apr 30 10:20:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Ruben van Staveren
>Release: FreeBSD 7.0-STABLE i386
>Organization:
Verweg dot com
>Environment:
System: FreeBSD helium.verweg.com 7.0-STABLE FreeBSD 7.0-STABLE #21: Tue Apr 22 12:41:05 CEST 2008 root at helium.verweg.com:/usr/obj/usr/cvsup/7-stable/src/sys/HELIUM-SMP i386
>Description:
Atleast on FreeBSD 7 IPv6 detection fails because the snippet testing for
getaddrinfo fails because NULL is undefined. including stddef.h fixes this
using setsockopt with IPV6_V6ONLY = 0 on the listening sockets allows for both
v4 and v6 clients to connect.
(I'm not sure this socket option is supported on all platforms, and thus
getting this patched more upstream)
>How-To-Repeat:
Build current net-im/jabber with IPv6 enabled to see it only listens to IPv4 sockets.
>Fix:
diff -Nur jabber.orig/files/patch-configure jabber/files/patch-configure
--- jabber.orig/files/patch-configure 2007-02-27 14:13:26.000000000 +0100
+++ jabber/files/patch-configure 2008-04-29 18:51:38.000000000 +0200
@@ -1,6 +1,14 @@
---- configure.orig Sat Feb 17 10:54:39 2007
-+++ configure Sat Feb 17 10:56:22 2007
-@@ -23750,8 +23750,8 @@
+--- configure.orig 2007-07-19 00:24:45.000000000 +0200
++++ configure 2008-04-29 18:51:04.000000000 +0200
+@@ -21168,6 +21168,7 @@
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++#include <sys/stddef.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+@@ -22787,8 +22788,8 @@
CPPFLAGS="${CPPFLAGS} -I$postgresql/include"
fi
if test "${ac_cv_header_postgresql_libpq_fe_h+set}" = set; then
@@ -11,7 +19,7 @@
if test "${ac_cv_header_postgresql_libpq_fe_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-@@ -23759,8 +23759,8 @@
+@@ -22796,8 +22797,8 @@
echo "${ECHO_T}$ac_cv_header_postgresql_libpq_fe_h" >&6; }
else
# Is the header compilable?
@@ -22,7 +30,7 @@
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
-@@ -23768,7 +23768,7 @@
+@@ -22805,7 +22806,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
@@ -31,7 +39,7 @@
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
-@@ -23817,15 +23817,15 @@
+@@ -22837,15 +22838,15 @@
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
@@ -50,7 +58,7 @@
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
-@@ -23865,30 +23865,30 @@
+@@ -22878,30 +22879,30 @@
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
yes:no: )
diff -Nur jabber.orig/files/patch-jabberd-lib-socket.cc jabber/files/patch-jabberd-lib-socket.cc
--- jabber.orig/files/patch-jabberd-lib-socket.cc 1970-01-01 01:00:00.000000000 +0100
+++ jabber/files/patch-jabberd-lib-socket.cc 2008-04-29 19:05:49.000000000 +0200
@@ -0,0 +1,11 @@
+--- jabberd/lib/socket.cc.orig 2007-07-17 01:20:44.000000000 +0200
++++ jabberd/lib/socket.cc 2008-04-29 19:05:42.000000000 +0200
+@@ -95,6 +95,8 @@
+ sa.sin_addr.s_addr = saddr->s_addr;
+ #endif
+
++ flag = 0;
++ setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&flag, sizeof(flag));
+ if(bind(s,(struct sockaddr*)&sa,sizeof sa) < 0)
+ {
+ close(s);
diff -Nur jabber.orig/files/patch-jabberd-mio.cc jabber/files/patch-jabberd-mio.cc
--- jabber.orig/files/patch-jabberd-mio.cc 1970-01-01 01:00:00.000000000 +0100
+++ jabber/files/patch-jabberd-mio.cc 2008-04-29 19:01:27.000000000 +0200
@@ -0,0 +1,17 @@
+--- jabberd/mio.cc.orig 2008-04-29 18:54:19.000000000 +0200
++++ jabberd/mio.cc 2008-04-29 19:00:45.000000000 +0200
+@@ -673,11 +673,14 @@
+ sa.sin6_flowinfo = 0;
+
+ inet_pton(AF_INET6, addr_str, &sa.sin6_addr);
++ flag = 0;
++ setsockopt(newm->fd, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&flag, sizeof(flag));
+ #else
+ struct sockaddr_in sa;
+ sa.sin_family = AF_INET;
+ sa.sin_port = 0;
+ inet_aton(xmlnode_get_data(xmlnode_get_list_item(xmlnode_get_tags(greymatter__, "io/bind", namespaces, temp_pool), 0)), &sa.sin_addr);
++
+ #endif
+ bind(newm->fd, (struct sockaddr*)&sa, sizeof(sa));
+ }
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list