[asterisk-commits] mmichelson: branch mmichelson/acl-v6 r276489 - /team/mmichelson/acl-v6/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 14 15:45:00 CDT 2010


Author: mmichelson
Date: Wed Jul 14 15:44:48 2010
New Revision: 276489

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=276489
Log:
Prevent stored network address from changing when applying a netmask.


Modified:
    team/mmichelson/acl-v6/main/acl.c

Modified: team/mmichelson/acl-v6/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/acl-v6/main/acl.c?view=diff&rev=276489&r1=276488&r2=276489
==============================================================================
--- team/mmichelson/acl-v6/main/acl.c (original)
+++ team/mmichelson/acl-v6/main/acl.c Wed Jul 14 15:44:48 2010
@@ -350,13 +350,18 @@
 	struct sockaddr_in6 *addr6;
 	struct sockaddr_in6 *mask6 = (struct sockaddr_in6 *) &netmask->ss;
 	struct sockaddr_in6 result6 = {0,};
+	struct ast_sockaddr mapped_addr;
+	struct ast_sockaddr *addr_to_use;
 	int i;
 
 	if (ast_sockaddr_is_ipv4(addr)) {
-		make_v4_mapped(addr, addr);
-	}
-
-	addr6 = (struct sockaddr_in6 *) &addr->ss;
+		make_v4_mapped(addr, &mapped_addr);
+		addr_to_use = &mapped_addr;
+	} else {
+		addr_to_use = addr;
+	}
+
+	addr6 = (struct sockaddr_in6 *) &addr_to_use->ss;
 
 	result6.sin6_family = AF_INET6;
 	for (i = 0; i < 4; ++i) {




More information about the asterisk-commits mailing list