From owner-svn-src-head@freebsd.org Tue Dec 22 12:01:08 2015 Return-Path: Delivered-To: svn-src-head@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 4D1E6A4EED8; Tue, 22 Dec 2015 12:01:08 +0000 (UTC) (envelope-from ume@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 1C80015B7; Tue, 22 Dec 2015 12:01:08 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMC17qg088448; Tue, 22 Dec 2015 12:01:07 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMC174P088447; Tue, 22 Dec 2015 12:01:07 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512221201.tBMC174P088447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Tue, 22 Dec 2015 12:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292595 - 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.20 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: Tue, 22 Dec 2015 12:01:08 -0000 Author: ume Date: Tue Dec 22 12:01:06 2015 New Revision: 292595 URL: https://svnweb.freebsd.org/changeset/base/292595 Log: We don't need to use a temporary buffer, here. MFC after: 1 week Modified: head/lib/libc/net/map_v4v6.c Modified: head/lib/libc/net/map_v4v6.c ============================================================================== --- head/lib/libc/net/map_v4v6.c Tue Dec 22 09:55:44 2015 (r292594) +++ head/lib/libc/net/map_v4v6.c Tue Dec 22 12:01:06 2015 (r292595) @@ -78,15 +78,11 @@ typedef union { void _map_v4v6_address(const char *src, char *dst) { - char tmp[NS_INADDRSZ]; - - /* Stash a temporary copy so our caller can update in place. */ - memcpy(tmp, src, NS_INADDRSZ); + /* Our caller may update in place. */ + memmove(&dst[12], src, NS_INADDRSZ); /* Mark this ipv6 addr as a mapped ipv4. */ - memset(&dst[0], 0, 10); memset(&dst[10], 0xff, 2); - /* Retrieve the saved copy and we're done. */ - memcpy(&dst[12], tmp, NS_INADDRSZ); + memset(&dst[0], 0, 10); } void