diff --git a/scripts/targets-sniffer.nse b/scripts/targets-sniffer.nse index 3577c7326..4bb616261 100644 --- a/scripts/targets-sniffer.nse +++ b/scripts/targets-sniffer.nse @@ -90,9 +90,11 @@ action = function() stdnse.get_script_interfaces(collect_interface) end - if interface_info==nil then -- Check if we have the interface information + if not interface_info then -- Check if we have the interface information stdnse.debug1("Error: Unable to get interface info. Did you specify the correct interface using 'targets-sniffer.interface=' or '-e '?") return + elseif not interface then + interface = interface_info.shortname end