Merge pull request #863 from cdosoftei/apr-ipv6-tweak

[apr] fix find_if_index for BSDs/mac
This commit is contained in:
Andrey Volk 2020-09-22 22:25:09 +04:00 committed by GitHub
commit e1879a8e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

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