Pull default connection_timeout into constant

bug/bundler_fix
William Vu 2015-05-06 13:05:57 -05:00
parent d4aed08260
commit 669df591f2
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ module Metasploit
class SNMP
include Metasploit::Framework::LoginScanner::Base
DEFAULT_TIMEOUT = 2
DEFAULT_PORT = 161
DEFAULT_RETRIES = 0
DEFAULT_VERSION = 'all'
@ -117,7 +118,7 @@ module Metasploit
# Sets the connection timeout appropriately for SNMP
# if the user did not set it.
def set_sane_defaults
self.connection_timeout = 2 if self.connection_timeout.nil?
self.connection_timeout = DEFAULT_TIMEOUT if self.connection_timeout.nil?
self.port = DEFAULT_PORT if self.port.nil?
self.retries = DEFAULT_RETRIES if self.retries.nil?
self.version = DEFAULT_VERSION if self.version.nil?