1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00
This commit is contained in:
Jakub Jelinek
2007-07-31 13:33:18 +00:00
parent d6220e9ee3
commit 32c075e1f0
448 changed files with 13841 additions and 10982 deletions

View File

@@ -56,14 +56,16 @@ static void
map_v4v6_address (const char *src, char *dst)
{
u_char *p = (u_char *) dst;
char tmp[INADDRSZ];
int i;
/* Move the IPv4 part to the right position. */
memcpy (dst + 12, src, INADDRSZ);
/* Stash a temporary copy so our caller can update in place. */
memcpy (tmp, src, INADDRSZ);
/* Mark this ipv6 addr as a mapped ipv4. */
for (i = 0; i < 10; i++)
*p++ = 0x00;
*p++ = 0xff;
*p = 0xff;
*p++ = 0xff;
/* Retrieve the saved copy and we're done. */
memcpy ((void *) p, tmp, INADDRSZ);
}