core: fix build on Darwin
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Tue, 16 Dec 2008 14:34:04 +0000 (14:34 +0000)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Tue, 16 Dec 2008 14:34:04 +0000 (14:34 +0000)
Author: Alfred Heggestad <aeh@db.org>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

ip_addr.c
ip_addr.h

index e17a69d..3efdeb9 100644 (file)
--- a/ip_addr.c
+++ b/ip_addr.c
@@ -190,7 +190,7 @@ int is_mcast(struct ip_addr* ip)
                return IN_MULTICAST(htonl(ip->u.addr32[0]));
 #ifdef USE_IPV6
        } else if (ip->af==AF_INET6){
-               return IN6_IS_ADDR_MULTICAST(&ip->u.addr32[0]);
+               return IN6_IS_ADDR_MULTICAST((struct in6_addr*)ip->u.addr32);
 #endif /* USE_IPV6 */
        } else {
                LOG(L_ERR, "ERROR: is_mcast: Unsupported protocol family\n");
index 6849a87..fdaf6f3 100644 (file)
--- a/ip_addr.h
+++ b/ip_addr.h
@@ -242,7 +242,7 @@ inline static int ip_addr_loopback(struct ip_addr* ip)
                return ip->u.addr32[0]==htonl(INADDR_LOOPBACK);
 #ifdef USE_IPV6
        else if (ip->af==AF_INET6)
-               return IN6_IS_ADDR_LOOPBACK(&ip->u.addr32[0]);
+               return IN6_IS_ADDR_LOOPBACK((struct in6_addr*)ip->u.addr32);
 #endif /* USE_IPV6 */
        return 0;
 }