Date: Mon, 5 Sep 2016 00:41:17 +0000 (UTC) From: "Andrey A. Chernov" <ache@FreeBSD.org> 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 Message-ID: <201609050041.u850fHbZ012822@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609050041.u850fHbZ012822>