Fix error with mixed address family ACLs.
[asterisk/asterisk.git] / main / acl.c
index a9f6c46..fa1e35c 100644 (file)
@@ -743,7 +743,7 @@ enum ast_acl_sense ast_apply_ha(const struct ast_ha *ha, const struct ast_sockad
                ast_copy_string(iabuf2, ast_inet_ntoa(ha->netaddr), sizeof(iabuf2));
                ast_debug(1, "##### Testing %s with %s\n", iabuf, iabuf2);
 #endif
-               if (ast_sockaddr_is_ipv4(&ha->addr)) {
+               if (ast_sockaddr_is_ipv4(&current_ha->addr)) {
                        if (ast_sockaddr_is_ipv6(addr)) {
                                if (ast_sockaddr_is_ipv4_mapped(addr)) {
                                        /* IPv4 ACLs apply to IPv4-mapped addresses */