just use boolean @@support_ipv6 instead of "yes"/"no"

git-svn-id: file:///home/svn/framework3/trunk@6047 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
kris 2008-12-26 07:11:49 +00:00
parent b03360f5e0
commit b012696f1f
2 changed files with 12 additions and 10 deletions

View File

@ -46,6 +46,10 @@ class Driver < Msf::Ui::Driver
# Whether or not unknown commands should be passed through and executed by
# the local system.
#
# NoBanner
#
# Don't display a banner message
#
def initialize(prompt = DefaultPrompt, prompt_char = DefaultPromptChar, opts = {})
if (Rex::Compat.is_windows())
@ -91,7 +95,7 @@ class Driver < Msf::Ui::Driver
self.framework.modules.add_module_path(opts['ModulePath'], false) if opts['ModulePath']
# Process things before we actually display the prompt and get rocking
on_startup
on_startup(opts)
# Process the resource script
load_resource(opts['Resource'])
@ -205,7 +209,7 @@ class Driver < Msf::Ui::Driver
# Called before things actually get rolling such that banners can be
# displayed, scripts can be processed, and other fun can be had.
#
def on_startup
def on_startup(opts)
# Check for modules that failed to load
if (framework.modules.failed.length > 0)
print("[*] WARNING! The following modules could not be loaded!\n\n")
@ -216,7 +220,7 @@ class Driver < Msf::Ui::Driver
end
# Build the banner message
run_single("banner")
run_single("banner") if not opts['NoBanner']
end
#

View File

@ -87,22 +87,20 @@ module Socket
# Determine whether we support IPv6
#
def self.support_ipv6?
if(@@support_ipv6)
return (@@support_ipv6 == "yes" ? true : false)
end
@@support_ipv6 = "no"
return @@support_ipv6 if not @@support_ipv6.nil?
@@support_ipv6 = false
if (::Socket.const_defined?('AF_INET6'))
begin
s = ::Socket.new(::Socket::AF_INET6, ::Socket::SOCK_DGRAM, ::Socket::IPPROTO_UDP)
s.close
@@support_ipv6 = "yes"
@@support_ipv6 = true
rescue
end
end
return (@@support_ipv6 == "yes" ? true : false)
return @@support_ipv6
end
#