apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1696140 - /apr/apr/trunk/network_io/unix/multicast.c
Date Sun, 16 Aug 2015 14:14:42 GMT
Author: sf
Date: Sun Aug 16 14:14:42 2015
New Revision: 1696140

URL: http://svn.apache.org/r1696140
Log:
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

Modified:
    apr/apr/trunk/network_io/unix/multicast.c

Modified: apr/apr/trunk/network_io/unix/multicast.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/multicast.c?rev=1696140&r1=1696139&r2=1696140&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/multicast.c (original)
+++ apr/apr/trunk/network_io/unix/multicast.c Sun Aug 16 14:14:42 2015
@@ -65,7 +65,7 @@ static unsigned int find_if_index(const
     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;



Mime
View raw message