From 12ae55aaecc1144588aee8c97526d83c3b0aaf96 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 24 Apr 2025 19:19:09 +0200 Subject: [PATCH] Fix logic bug in find_hosts caching The single = resulted in the value being assigned. If it's non-nil then it will also be true, even though the code suggests it was intended as a condition. In f87a1a83f2a3e3e8cad2c241b56695bd99c85c1a it was changed, but it looks like that may have been accidental. Fixes: f87a1a83f2a3 ("Fixes #21025 - support for non-default dns and network views.") --- lib/smart_proxy_dhcp_infoblox/fixed_address_crud.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smart_proxy_dhcp_infoblox/fixed_address_crud.rb b/lib/smart_proxy_dhcp_infoblox/fixed_address_crud.rb index febb03c..6c22cb1 100644 --- a/lib/smart_proxy_dhcp_infoblox/fixed_address_crud.rb +++ b/lib/smart_proxy_dhcp_infoblox/fixed_address_crud.rb @@ -65,7 +65,7 @@ def find_record_by_mac(subnet_address, mac_address) end def find_hosts(condition, max_results = 1) - return @memoized_hosts if (!@memoized_hosts.empty? && @memoized_condition = condition) + return @memoized_hosts if !@memoized_hosts.empty? && @memoized_condition == condition @memoized_condition = condition @memoized_hosts = ::Infoblox::Fixedaddress.find(@connection, condition.merge('_max_results' => max_results,