File ganglia-3.7.2-no-private-apr.patch of Package ganglia
--- ganglia-3.1.7.orig/lib/apr_net.c
+++ ganglia-3.1.7/lib/apr_net.c
@@ -12,7 +12,7 @@
* FIXME: apr_arch_networkio.h is not public
* define interfaces locally so they can be used
*/
-void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
+//void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
/*
* FIXME: incomplete definition but enough to manipulate socketdes directly
@@ -38,7 +38,7 @@ struct apr_socket_t {
#include <gm_msg.h>
-const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
+//const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
/* This function is copied directly from the
* apr_sockaddr_ip_get() function and modified to take a static
@@ -54,7 +54,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_i
* old code...
*addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len);
*/
- apr_inet_ntop(sockaddr->family,
+ inet_ntop(sockaddr->family,
sockaddr->ipaddr_ptr,
addr,
sockaddr->addr_str_len);
@@ -77,6 +77,32 @@ APR_DECLARE(apr_status_t) apr_sockaddr_i
return APR_SUCCESS;
}
+static void ganglia_apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port)
+{
+ addr->family = family;
+ addr->sa.sin.sin_family = family;
+ if (port) {
+ /* XXX IPv6: assumes sin_port and sin6_port at same offset */
+ addr->sa.sin.sin_port = htons(port);
+ addr->port = port;
+ }
+
+ if (family == APR_INET) {
+ addr->salen = sizeof(struct sockaddr_in);
+ addr->addr_str_len = 16;
+ addr->ipaddr_ptr = &(addr->sa.sin.sin_addr);
+ addr->ipaddr_len = sizeof(struct in_addr);
+ }
+#if APR_HAVE_IPV6
+ else if (family == APR_INET6) {
+ addr->salen = sizeof(struct sockaddr_in6);
+ addr->addr_str_len = 46;
+ addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr);
+ addr->ipaddr_len = sizeof(struct in6_addr);
+ }
+#endif
+}
+
static apr_status_t
mcast_emit_on_if( apr_pool_t *context, apr_socket_t *sock, const char *mcast_channel, apr_port_t port, const char *ifname);
@@ -206,7 +232,7 @@ create_net_server(apr_pool_t *context, i
if(!localsa)
{
apr_socket_addr_get(&localsa, APR_LOCAL, sock);
- apr_sockaddr_vars_set(localsa, localsa->family, port);
+ ganglia_apr_sockaddr_vars_set(localsa, localsa->family, port);
}
#if APR_HAVE_IPV6