On Fri, Jul 15, 2005 at 02:23:29PM +0300, Mihai Rusu wrote:
> Ok, but it seems to fail in "simplesocketserver", "performance", "tests"
> (and any program linking to log4cxx) because of:
> /usr/lib/libapr-1.so: undefined reference to `sock_is_ipv6'
> /usr/lib/libapr-1.so: undefined reference to `find_if_index'
>
> Any idea ?
Hmm, this might not be the best place for this message but it seems that
apr 1.1.1 has some nasty bugs (showed up when linking against libapr
when had apr compiled without IPv6 but it seems to affect users
compiling with IPv6 too). My quick hack/fix is:
--- apr-1.1.1/network_io/unix/multicast.c 2005-03-16 00:41:02.000000000 +0200
+++ apr-1.1.1.dizzy/network_io/unix/multicast.c 2005-07-15 16:25:19.000000000 +0300
@@ -56,7 +56,6 @@
}
}
-#if APR_HAVE_IPV6
static unsigned int find_if_index(const apr_sockaddr_t *iface)
{
unsigned int index = 0;
@@ -76,6 +75,7 @@
}
for (ifp = ifs; ifp; ifp = ifp->ifa_next) {
+#if APR_HAVE_IPV6
if (ifp->ifa_addr != NULL && ifp->ifa_addr->sa_family == AF_INET6)
{
if (memcmp(&iface->sa.sin6.sin6_addr,
&ifp->ifa_addr->sa_data[0],
@@ -84,6 +84,7 @@
break;
}
}
+#endif
}
freeifaddrs(ifs);
@@ -91,6 +92,7 @@
return index;
}
+#if APR_HAVE_IPV6
static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast,
const apr_sockaddr_t *iface)
{
@@ -145,10 +147,12 @@
if (source != NULL) {
#if MCAST_JOIN_SOURCE_GROUP
- if (sock_is_ipv6(sock))
+ if (sock_is_ipv4(sock))
ip_proto = IPPROTO_IP;
+#if APR_HAVE_IPV6
else if (sock_is_ipv6(sock))
ip_proto = IPPROTO_IPV6;
+#endif
else
return APR_ENOTIMPL;
The sock_is_ipv6 -> sock_is_ipv4 change points to a bug that seems to
affect people compiling with IPv6 too.
--
Mihai RUSU Email: dizzy@roedu.net
GPG : http://dizzy.roedu.net/dizzy-gpg.txt WWW: http://dizzy.roedu.net
"Linux is obsolete" -- AST
|