Skip to content

Commit

Permalink
Land #18744, Fix flakey opt address local spec
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-r7 authored Jan 26, 2024
2 parents 2f97f86 + 5c25bfd commit 3cbbfe6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/lib/msf/core/opt_address_local_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
IPAddr.new(addr).ipv4? && !addr[/^127.*/]
rescue IPAddr::InvalidAddressError
false
end.sort_by do |addr|
ip_addr = IPAddr.new(addr)
[ip_addr.ipv4? ? 0 : 1, ip_addr.to_i]
end.first
{ name: iface, addr: ip_address }
end.select { |name_addr| name_addr[:addr] }.sort_by do |name_addr|
ip_addr = IPAddr.new(name_addr[:addr])
[ip_addr.ipv4?, ip_addr.to_i]
[ip_addr.ipv4? ? 0 : 1, ip_addr.to_i]
end.first

valid_values = [
Expand Down

0 comments on commit 3cbbfe6

Please sign in to comment.