pcaprub: add a respond_to? in the capture mixin to ensure latest version

git-svn-id: file:///home/svn/framework3/trunk@12565 4d416f70-5f16-0410-b530-b9f4589650da
unstable
amaloteaux 2011-05-08 04:43:24 +00:00
parent 09a2bceec5
commit cb72073cd8
1 changed files with 5 additions and 1 deletions

View File

@ -373,9 +373,13 @@ module Exploit::Capture
end
def check_pcaprub_loaded
unless @pcaprub_loaded
if not @pcaprub_loaded
print_status("The Pcaprub module is not available: #{@pcaprub_error}")
raise RuntimeError, "Pcaprub not available"
#Those methods have been added later
elsif (not Pcap.respond_to? "lookupaddrs")
print_status("The Pcaprub module is not up-to-date")
raise RuntimeError, "The Pcaprub module is missing some functions"
else
true
end