summaryrefslogtreecommitdiff
path: root/net/libfetch
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2012-10-15 22:43:24 +0000
committerjoerg <joerg@pkgsrc.org>2012-10-15 22:43:24 +0000
commite91eff60f1c81ba0e370ab3c88203d1da3d21806 (patch)
tree01d709b3332a142ac27a22b41c316f8088c4549c /net/libfetch
parent6a122f254061c00cae0f17266c09a35cd404ed79 (diff)
downloadpkgsrc-e91eff60f1c81ba0e370ab3c88203d1da3d21806.tar.gz
Use s6_addr32 if present as macro and fallback to memcpy otherwise.
Diffstat (limited to 'net/libfetch')
-rw-r--r--net/libfetch/files/ftp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/libfetch/files/ftp.c b/net/libfetch/files/ftp.c
index b849d4e0a5e..3eea3407b00 100644
--- a/net/libfetch/files/ftp.c
+++ b/net/libfetch/files/ftp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.42 2012/04/07 15:27:21 joerg Exp $ */
+/* $NetBSD: ftp.c,v 1.43 2012/10/15 22:43:24 joerg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger <joerg@NetBSD.org>
@@ -146,7 +146,11 @@ unmappedaddr(struct sockaddr_in6 *sin6, socklen_t *len)
!IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
return;
sin4 = (struct sockaddr_in *)sin6;
- addr = *(uint32_t *)&sin6->sin6_addr.s6_addr[12];
+#ifdef s6_addr32
+ addr = sin6->sin6_addr.s6_addr32[3];
+#else
+ memcpy(&addr, &sin6->sin6_addr.s6_addr[12], sizeof(addr));
+#endif
port = sin6->sin6_port;
memset(sin4, 0, sizeof(struct sockaddr_in));
sin4->sin_addr.s_addr = addr;