Fix comparison of IPv6 prefixes

Typo assigned prefixlen1 twice instead of to the two different variables
for comparison and difference computation.

Change-Id: I6631b8269ca6aae264c8d7d414127b756838df96
This commit is contained in:
Kenny Root 2010-03-24 18:06:20 -07:00
parent 4e383b81d0
commit 7e0bfb511e

View File

@ -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;
}