diff options
author | sf <sf@13f79535-47bb-0310-9956-ffa450edef68> | 2015-08-16 14:22:01 +0000 |
---|---|---|
committer | sf <sf@13f79535-47bb-0310-9956-ffa450edef68> | 2015-08-16 14:22:01 +0000 |
commit | 42a0f703ecf6d543057965ead6d79527662e1065 (patch) | |
tree | a166733c33424245cb2dfca015c76939c3481707 | |
parent | fbac945dc2117acd0d5d3ea422f13edb7ec82dc7 (diff) | |
download | libapr-42a0f703ecf6d543057965ead6d79527662e1065.tar.gz |
Merge r1696141 from 1.6.x:
Merge r1696140 from trunk:
fix comparison of sin6_addr
One cannot assume that sin6_addr is located at the start of sa_data.
For example, glibc puts sin6_flowinfo there.
Fix by casting to the proper type first.
Reported by Andre Naujoks <nautsch2 gmail com> via
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759534
------------------------------------------------------------------------
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1696146 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | network_io/unix/multicast.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.5.3 + *) apr_mcast_interface/apr_mcast_join: Fix comparison of IPv6 addresses. + [ Andre Naujoks <nautsch2 gmail com> ] + *) apr_filepath_merge: Fix truename length calculation on Windows in cases where the "short" name variant is actually longer than the "long" or "true" name. See: testnames.c:merge_shortname(). diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 3767bfdd1..a604b0600 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -62,7 +62,7 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) for (ifp = ifs; ifp; ifp = ifp->ifa_next) { if (ifp->ifa_addr != NULL && ifp->ifa_addr->sa_family == AF_INET6) { if (memcmp(&iface->sa.sin6.sin6_addr, - &ifp->ifa_addr->sa_data[0], + &((struct sockaddr_in6*)ifp->ifa_addr)->sin6_addr, sizeof(iface->sa.sin6.sin6_addr)) == 0) { index = if_nametoindex(ifp->ifa_name); break; |