#include "rsync.h"
-#ifndef HAVE_GETADDRINFO
-#include "lib/addrinfo.h"
-#endif
-
/* Establish a proxy connection on an open socket to a web roxy by
* using the CONNECT method. */
static int establish_proxy_connection(int fd, char *host, int port)
}
+static sa_family_t get_sockaddr_family(const struct sockaddr_storage *ss)
+{
+ return ((struct sockaddr *) ss)->sa_family;
+}
+
+
/**
* Return the DNS name of the client
**/
}
#ifdef INET6
- if (ss.ss_family == AF_INET6 &&
+ if (get_sockaddr_family(&ss) == AF_INET6 &&
IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&ss)->sin6_addr)) {
struct sockaddr_in6 sin6;
struct sockaddr_in *sin;
/* XXX sin6_flowinfo and other fields */
for (res = res0; res; res = res->ai_next) {
- if (res->ai_family != ss.ss_family)
+ if (res->ai_family != get_sockaddr_family(&ss))
continue;
if (res->ai_addrlen != length)
continue;