[dovecot-cvs] dovecot/src/auth auth-request.c,1.66,1.67

tss at dovecot.org tss at dovecot.org
Sun Oct 15 17:20:04 UTC 2006


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv23092/auth

Modified Files:
	auth-request.c 
Log Message:
When matching allowed_nets IPs, convert IPv6-mapped-IPv4 addresses to actual
IPv4 addresses first.



Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- auth-request.c	13 Oct 2006 16:37:14 -0000	1.66
+++ auth-request.c	15 Oct 2006 16:20:01 -0000	1.67
@@ -669,11 +669,14 @@
 static int is_ip_in_network(const char *network, const struct ip_addr *ip)
 {
 	const uint32_t *ip1, *ip2;
-	struct ip_addr net_ip;
+	struct ip_addr src_ip, net_ip;
 	const char *p;
 	unsigned int max_bits, bits, pos, i;
 	uint32_t mask;
 
+	if (net_ipv6_mapped_ipv4_convert(ip, &src_ip) == 0)
+		ip = &src_ip;
+
 	max_bits = IPADDR_IS_V4(ip) ? 32 : 128;
 	p = strchr(network, '/');
 	if (p == NULL) {



More information about the dovecot-cvs mailing list