summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2020-11-16 22:12:56 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2020-11-16 22:12:56 +0100
commitf028b4bdca6714f7426777b5226db60de5a6aeb2 (patch)
tree7ddbc4033bb79f878266acd454ed3d7b0ad3331e
parent07642383302cdd33be6cab0fea574b753ab0962e (diff)
fix memcpy size
-rw-r--r--src/sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sock.c b/src/sock.c
index b11babb..ba65111 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -388,13 +388,13 @@ int getsock_ip (int fd, char *ipaddr)
int getmapped_ipv4 (const char *ipv6mapped_conf, const char *ipaddr, char *ipaddr_mapped)
{
struct in6_addr addr6;
- struct in_addr addr;
+ struct in_addr addr;
memset(&addr6, 0, sizeof(addr6));
if ( inet_pton(AF_INET6, ipaddr, &addr6) < 0 )
return -1;
- memcpy(&addr, addr6.s6_addr + 12, sizeof(&addr));
+ memcpy(&addr, addr6.s6_addr + 12, sizeof(addr));
return inet_ntop(AF_INET, &addr, ipaddr_mapped, IP_LENGTH) == NULL ? -1 : 0;
}