svn commit: r305401 - stable/10/lib/libc/net

Andrey A. Chernov ache at FreeBSD.org
Mon Sep 5 00:36:54 UTC 2016


Author: ache
Date: Mon Sep  5 00:36:52 2016
New Revision: 305401
URL: https://svnweb.freebsd.org/changeset/base/305401

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 at stratus.com

Modified:
  stable/10/lib/libc/net/getaddrinfo.c
  stable/10/lib/libc/net/name6.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/net/getaddrinfo.c
==============================================================================
--- stable/10/lib/libc/net/getaddrinfo.c	Sun Sep  4 22:55:05 2016	(r305400)
+++ stable/10/lib/libc/net/getaddrinfo.c	Mon Sep  5 00:36:52 2016	(r305401)
@@ -931,7 +931,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/10/lib/libc/net/name6.c
==============================================================================
--- stable/10/lib/libc/net/name6.c	Sun Sep  4 22:55:05 2016	(r305400)
+++ stable/10/lib/libc/net/name6.c	Mon Sep  5 00:36:52 2016	(r305401)
@@ -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;
 			}


More information about the svn-src-all mailing list