mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-05 09:14:03 +00:00
We don't need to use a temporary buffer, here.
MFC after: 1 week
This commit is contained in:
parent
beebd9aac8
commit
eedae89765
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292595
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user