svn commit: r292827 - stable/9/lib/libc/net

Hajimu UMEMOTO ume at FreeBSD.org
Mon Dec 28 03:39:33 UTC 2015


Author: ume
Date: Mon Dec 28 03:39:32 2015
New Revision: 292827
URL: https://svnweb.freebsd.org/changeset/base/292827

Log:
  MFC r292445, r292554:
    Use _map_v4v6_address().

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

Modified: stable/9/lib/libc/net/getaddrinfo.c
==============================================================================
--- stable/9/lib/libc/net/getaddrinfo.c	Mon Dec 28 03:37:13 2015	(r292826)
+++ stable/9/lib/libc/net/getaddrinfo.c	Mon Dec 28 03:39:32 2015	(r292827)
@@ -777,10 +777,9 @@ match_addrselectpolicy(struct sockaddr *
 		memset(&key, 0, sizeof(key));
 		key.sin6_family = AF_INET6;
 		key.sin6_len = sizeof(key);
-		key.sin6_addr.s6_addr[10] = 0xff;
-		key.sin6_addr.s6_addr[11] = 0xff;
-		memcpy(&key.sin6_addr.s6_addr[12],
-		       &((struct sockaddr_in *)addr)->sin_addr, 4);
+		_map_v4v6_address(
+		    (char *)&((struct sockaddr_in *)addr)->sin_addr,
+		    (char *)&key.sin6_addr);
 		break;
 	default:
 		return(NULL);

Modified: stable/9/lib/libc/net/name6.c
==============================================================================
--- stable/9/lib/libc/net/name6.c	Mon Dec 28 03:37:13 2015	(r292826)
+++ stable/9/lib/libc/net/name6.c	Mon Dec 28 03:39:32 2015	(r292827)
@@ -799,10 +799,9 @@ match_addrselectpolicy(struct sockaddr *
 		memset(&key, 0, sizeof(key));
 		key.sin6_family = AF_INET6;
 		key.sin6_len = sizeof(key);
-		key.sin6_addr.s6_addr[10] = 0xff;
-		key.sin6_addr.s6_addr[11] = 0xff;
-		memcpy(&key.sin6_addr.s6_addr[12],
-		       &((struct sockaddr_in *)addr)->sin_addr, 4);
+		_map_v4v6_address(
+		    (char *)&((struct sockaddr_in *)addr)->sin_addr,
+		    (char *)&key.sin6_addr);
 		break;
 	default:
 		return(NULL);


More information about the svn-src-stable-9 mailing list