summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-03-24 18:06:20 -0700
committerKenny Root <kroot@google.com>2010-03-24 18:07:26 -0700
commit7e0bfb511e85834d7c6cb9631206b62f82701d60 (patch)
tree9579d38c3ba80e5cdd2f39b2168ac678f8615182
parent4e383b81d03db3592a43766dd6f996e7f84d8dc7 (diff)
downloadbionic-7e0bfb511e85834d7c6cb9631206b62f82701d60.zip
bionic-7e0bfb511e85834d7c6cb9631206b62f82701d60.tar.gz
bionic-7e0bfb511e85834d7c6cb9631206b62f82701d60.tar.bz2
Fix comparison of IPv6 prefixes
Typo assigned prefixlen1 twice instead of to the two different variables for comparison and difference computation. Change-Id: I6631b8269ca6aae264c8d7d414127b756838df96
-rw-r--r--libc/netbsd/net/getaddrinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c
index a16f1db..51079ae 100644
--- a/libc/netbsd/net/getaddrinfo.c
+++ b/libc/netbsd/net/getaddrinfo.c
@@ -1498,7 +1498,7 @@ _rfc3484_compare(const void *ptr1, const void* ptr2)
const struct sockaddr_in6 *a2_src = (const struct sockaddr_in6 *)&a2->src_addr;
const struct sockaddr_in6 *a2_dst = (const struct sockaddr_in6 *)a2->ai->ai_addr;
prefixlen1 = _common_prefix_len(&a1_src->sin6_addr, &a1_dst->sin6_addr);
- prefixlen1 = _common_prefix_len(&a2_src->sin6_addr, &a2_dst->sin6_addr);
+ prefixlen2 = _common_prefix_len(&a2_src->sin6_addr, &a2_dst->sin6_addr);
if (prefixlen1 != prefixlen2) {
return prefixlen2 - prefixlen1;
}