Case no Rex UDP socket is passed to RexUDPTransport use Standard UDP socket
git-svn-id: file:///home/svn/framework3/trunk@6533 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
6bb267f31d
commit
84f9f344cf
|
@ -49,8 +49,8 @@ module Exploit::Remote::SNMPClient
|
|||
:Version => version,
|
||||
:Timeout => datastore['TIMEOUT'],
|
||||
:Retries => datastore['RETRIES'],
|
||||
:Transport => SNMP::RexUDPTransport,
|
||||
:Socket => s
|
||||
:Transport => SNMP::RexUDPTransport
|
||||
#:Socket => s
|
||||
)
|
||||
|
||||
@snmp = snmp if global
|
||||
|
|
|
@ -58,7 +58,12 @@ class RexUDPTransport
|
|||
end
|
||||
|
||||
def send(data, host, port, flags = 0)
|
||||
@socket.sendto(data, host, port, flags)
|
||||
begin
|
||||
@socket.sendto(data, host, port, flags)
|
||||
rescue NoMethodError
|
||||
@socket.send(data, 0, host, port)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def recv(max_bytes)
|
||||
|
|
Loading…
Reference in New Issue