]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[apr] fix find_if_index for BSDs/mac 863/head
authorcdosoftei <ciprian.dosoftei@gmail.com>
Mon, 21 Sep 2020 15:50:09 +0000 (11:50 -0400)
committercdosoftei <ciprian.dosoftei@gmail.com>
Mon, 21 Sep 2020 15:50:09 +0000 (11:50 -0400)
libs/apr/network_io/unix/multicast.c

index df98b5a7f01720493bd734182c9a7a8385d3cdcb..7f8f759dd7bc89afc526f2e15ca4c20da0bfbe82 100644 (file)
@@ -57,11 +57,10 @@ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast,
     }
 }
 
-#if APR_HAVE_IPV6
 static unsigned int find_if_index(const apr_sockaddr_t *iface)
 {
     unsigned int index = 0;
-#ifdef HAVE_GETIFADDRS
+#if defined(HAVE_GETIFADDRS) && APR_HAVE_IPV6
     struct ifaddrs *ifp, *ifs;
 
     /**
@@ -92,6 +91,7 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface)
     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)
 {
@@ -105,7 +105,6 @@ static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast,
         mip->ipv6mr_interface = find_if_index(iface);
     }
 }
-
 #endif
 
 static int sock_is_ipv4(apr_socket_t *sock)