summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2014-06-23 15:43:27 +0000
committerume <ume@FreeBSD.org>2014-06-23 15:43:27 +0000
commit1390d13ae69089142f6c6465dbb24438f295edee (patch)
treeb59c4d1bd38232f2c2cc0096a4cf1903446840e0 /lib/libc
parent0acd6ae59d4661b911b46150c1505a5178627ca6 (diff)
downloadFreeBSD-src-1390d13ae69089142f6c6465dbb24438f295edee.zip
FreeBSD-src-1390d13ae69089142f6c6465dbb24438f295edee.tar.gz
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing. MFC after: 1 week
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/getaddrinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 22b4103..77568a5 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1009,7 +1009,8 @@ comp_dst(const void *arg1, const void *arg2)
* We compare the match length in a same AF only.
*/
if (dst1->aio_ai->ai_addr->sa_family ==
- dst2->aio_ai->ai_addr->sa_family) {
+ dst2->aio_ai->ai_addr->sa_family &&
+ dst1->aio_ai->ai_addr->sa_family != AF_INET) {
if (dst1->aio_matchlen > dst2->aio_matchlen) {
return(-1);
}
OpenPOWER on IntegriCloud