Skip to content

Commit

Permalink
Fix flakey opt address local spec
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Jan 25, 2024
1 parent 6430b3f commit 5c25bfd
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 5c25bfd

Please sign in to comment.