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

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


Author: mmichelson
Date: Wed Jul 14 15:28:08 2010
New Revision: 276485

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=276485
Log:
* Change the way the netmask is set if none is specified
* Add missing doxygen to the end of apply_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=276485&r1=276484&r2=276485
==============================================================================
--- team/mmichelson/acl-v6/main/acl.c (original)
+++ team/mmichelson/acl-v6/main/acl.c Wed Jul 14 15:28:08 2010
@@ -340,6 +340,11 @@
  * When dealing with IPv6 addresses, one cannot apply a netmask with a simple
  * logical and operation. Furthermore, the incoming address may be an IPv4 address
  * and need to be mapped properly before attempting to apply a rule.
+ *
+ * \param addr The IP address to apply the mask to.
+ * \param netmask The netmask configured in the host access rule.
+ * \param result The resultant address after applying the netmask to the given address
+ * \retval void
  */
 static void apply_netmask(struct ast_sockaddr *addr, struct ast_sockaddr *netmask,
 		struct ast_sockaddr *result)
@@ -467,8 +472,7 @@
 	}
 
 	if (!mask) {
-		/* No need to check return value for hard-coded address */
-		ast_sockaddr_parse(&ha->netmask, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", PARSE_PORT_FORBID);
+		parse_cidr_mask(&ha->netmask, addr_is_v4, addr_is_v4 ? 32 : 128);
 	} else if (strchr(mask, ':') || strchr(mask, '.')) {
 		int mask_is_v4;
 		struct ast_sockaddr mask_sock;




More information about the asterisk-commits mailing list