Skip to content

Commit 669df59

Browse files
committed
Pull default connection_timeout into constant
1 parent d4aed08 commit 669df59

File tree

1 file changed

+2
-1
lines changed
  • lib/metasploit/framework/login_scanner

1 file changed

+2
-1
lines changed

lib/metasploit/framework/login_scanner/snmp.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module LoginScanner
1111
class SNMP
1212
include Metasploit::Framework::LoginScanner::Base
1313

14+
DEFAULT_TIMEOUT = 2
1415
DEFAULT_PORT = 161
1516
DEFAULT_RETRIES = 0
1617
DEFAULT_VERSION = 'all'
@@ -117,7 +118,7 @@ def has_write_access?(snmp_client, value)
117118
# Sets the connection timeout appropriately for SNMP
118119
# if the user did not set it.
119120
def set_sane_defaults
120-
self.connection_timeout = 2 if self.connection_timeout.nil?
121+
self.connection_timeout = DEFAULT_TIMEOUT if self.connection_timeout.nil?
121122
self.port = DEFAULT_PORT if self.port.nil?
122123
self.retries = DEFAULT_RETRIES if self.retries.nil?
123124
self.version = DEFAULT_VERSION if self.version.nil?

0 commit comments

Comments
 (0)