From e100325d56b72601e33d2da548577104d3460c2f Mon Sep 17 00:00:00 2001 From: "vitaly.osipov@gmail.com" Date: Sun, 9 Jan 2011 23:51:31 +0000 Subject: [PATCH] I have no idea how to reliably detect all network interfaces from Ruby. This commit fixes the duplicates but not "missing interfaces" in banner output git-svn-id: https://beef.googlecode.com/svn/trunk@687 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- lib/console/banner.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/console/banner.rb b/lib/console/banner.rb index c1c29fc1b..ae70155f1 100644 --- a/lib/console/banner.rb +++ b/lib/console/banner.rb @@ -19,6 +19,7 @@ module Console if beef_host == '0.0.0.0' # the framework will listen on all interfaces interfaces = Socket.getaddrinfo(Socket.gethostname, 'www', Socket::AF_INET, Socket::SOCK_STREAM).map { |x| x[3] } interfaces = interfaces << "127.0.0.1" + interfaces.uniq! else # the framework will listen on only one interface interfaces = [beef_host] end