From owner-svn-src-stable-11@freebsd.org Mon Sep 5 00:41:18 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DCAAB73029; Mon, 5 Sep 2016 00:41:18 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 30575288; Mon, 5 Sep 2016 00:41:18 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u850fHxp012824; Mon, 5 Sep 2016 00:41:17 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u850fHbZ012822; Mon, 5 Sep 2016 00:41:17 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609050041.u850fHbZ012822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Mon, 5 Sep 2016 00:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305402 - stable/11/lib/libc/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2016 00:41:18 -0000 Author: ache Date: Mon Sep 5 00:41:17 2016 New Revision: 305402 URL: https://svnweb.freebsd.org/changeset/base/305402 Log: MFC r305144 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com Modified: stable/11/lib/libc/net/getaddrinfo.c stable/11/lib/libc/net/name6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/11/lib/libc/net/getaddrinfo.c Mon Sep 5 00:36:52 2016 (r305401) +++ stable/11/lib/libc/net/getaddrinfo.c Mon Sep 5 00:41:17 2016 (r305402) @@ -949,7 +949,7 @@ matchlen(struct sockaddr *src, struct so while (s < lim) if ((r = (*d++ ^ *s++)) != 0) { - while (r < addrlen * 8) { + while ((r & 0x80) == 0) { match++; r <<= 1; } Modified: stable/11/lib/libc/net/name6.c ============================================================================== --- stable/11/lib/libc/net/name6.c Mon Sep 5 00:36:52 2016 (r305401) +++ stable/11/lib/libc/net/name6.c Mon Sep 5 00:41:17 2016 (r305402) @@ -930,7 +930,7 @@ matchlen(struct sockaddr *src, struct so while (s < lim) if ((r = (*d++ ^ *s++)) != 0) { - while (r < addrlen * 8) { + while ((r & 0x80) == 0) { match++; r <<= 1; }