Fix Socket#getifaddrs with ::

Rex::Socket#getifaddrs doesn't exist.
GSoC/Meterpreter_Web_Console
William Vu 2018-05-24 14:53:41 -05:00
parent a08aa09b96
commit da3df23f03
1 changed files with 3 additions and 3 deletions

View File

@ -289,9 +289,9 @@ module DispatcherShell
def tab_complete_source_address
addresses = [Rex::Socket.source_address]
# getifaddrs was introduced in 2.1.2
if Socket.respond_to?(:getifaddrs)
ifaddrs = Socket.getifaddrs.find_all do |ifaddr|
((ifaddr.flags & Socket::IFF_LOOPBACK) == 0) &&
if ::Socket.respond_to?(:getifaddrs)
ifaddrs = ::Socket.getifaddrs.find_all do |ifaddr|
((ifaddr.flags & ::Socket::IFF_LOOPBACK) == 0) &&
ifaddr.addr &&
ifaddr.addr.ip?
end