diff options
author | ume <ume@FreeBSD.org> | 2014-06-23 15:43:27 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2014-06-23 15:43:27 +0000 |
commit | 1390d13ae69089142f6c6465dbb24438f295edee (patch) | |
tree | b59c4d1bd38232f2c2cc0096a4cf1903446840e0 /lib/libc | |
parent | 0acd6ae59d4661b911b46150c1505a5178627ca6 (diff) | |
download | FreeBSD-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.c | 3 |
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); } |