diff options
author | ume <ume@FreeBSD.org> | 2014-06-30 16:53:12 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2014-06-30 16:53:12 +0000 |
commit | 1af4339c2a648a36660e5ea657d4234efe9ee5ea (patch) | |
tree | e6fcd112ad4ad4d5eb0728279c6054b7074c0b92 | |
parent | ab99acf70d1c9730272d59352116f05e44ee55e3 (diff) | |
download | FreeBSD-src-1af4339c2a648a36660e5ea657d4234efe9ee5ea.zip FreeBSD-src-1af4339c2a648a36660e5ea657d4234efe9ee5ea.tar.gz |
MFC r267800:
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing.
-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); } |