[dovecot-cvs] dovecot/src/lib network.c,1.39,1.40
tss at dovecot.org
tss at dovecot.org
Mon Oct 16 00:11:15 UTC 2006
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox istream-raw-mbox.c, 1.44, 1.45 istream-raw-mbox.h, 1.11, 1.12 mbox-sync-private.h, 1.57, 1.58 mbox-sync-rewrite.c, 1.66, 1.67 mbox-sync.c, 1.186, 1.187
- Next message: [dovecot-cvs] dovecot/src/lib network.c,1.38.2.1,1.38.2.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv2747
Modified Files:
network.c
Log Message:
Fix net_ipv6_mapped_ipv4_convert() to be actually portable.
Index: network.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/network.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- network.c 15 Oct 2006 16:19:17 -0000 1.39
+++ network.c 15 Oct 2006 23:11:12 -0000 1.40
@@ -574,15 +574,16 @@
struct ip_addr *dest)
{
#ifdef HAVE_IPV6
+ static uint8_t v4_prefix[] =
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
+
if (!IPADDR_IS_V6(src))
return -1;
- if (src->ip.in6_u.u6_addr32[0] != 0 ||
- src->ip.in6_u.u6_addr32[1] != 0 ||
- src->ip.in6_u.u6_addr32[2] != 0xffff0000)
+ if (memcmp(src->ip.s6_addr, v4_prefix, sizeof(v4_prefix)) != 0)
return -1;
dest->family = AF_INET;
- memcpy(&dest->ip, &src->ip.in6_u.u6_addr32[3], 4);
+ memcpy(&dest->ip, &src->ip.s6_addr[3*4], 4);
return 0;
#else
return -1;
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox istream-raw-mbox.c, 1.44, 1.45 istream-raw-mbox.h, 1.11, 1.12 mbox-sync-private.h, 1.57, 1.58 mbox-sync-rewrite.c, 1.66, 1.67 mbox-sync.c, 1.186, 1.187
- Next message: [dovecot-cvs] dovecot/src/lib network.c,1.38.2.1,1.38.2.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list