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-b9f4589650da
unstable
Ramon de C Valle 2009-05-08 20:26:22 +00:00
parent 6bb267f31d
commit 84f9f344cf
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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)