From owner-svn-src-head@FreeBSD.ORG Mon Jun 23 15:43:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0161E416; Mon, 23 Jun 2014 15:43:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2DF02548; Mon, 23 Jun 2014 15:43:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NFhRi0000584; Mon, 23 Jun 2014 15:43:27 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NFhRa7000583; Mon, 23 Jun 2014 15:43:27 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201406231543.s5NFhRa7000583@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 23 Jun 2014 15:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267800 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 15:43:28 -0000 Author: ume Date: Mon Jun 23 15:43:27 2014 New Revision: 267800 URL: http://svnweb.freebsd.org/changeset/base/267800 Log: Exclude IPv4 address from doing longest match. It prevented DNS based load balancing. MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Mon Jun 23 15:04:32 2014 (r267799) +++ head/lib/libc/net/getaddrinfo.c Mon Jun 23 15:43:27 2014 (r267800) @@ -1009,7 +1009,8 @@ comp_dst(const void *arg1, const void *a * 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); }