1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 03:19:02 +00:00

Don't use io.write to print error information.

This commit is contained in:
batrick
2010-12-08 14:08:35 +00:00
parent e9697cb936
commit 6fb600782f

View File

@@ -6,7 +6,8 @@
module(... or "packet" ,package.seeall)
require "bit"
local bit = require "bit"
local stdnse = require "stdnse"
----------------------------------------------------------------------------------------------------------------
@@ -142,15 +143,15 @@ function Packet:new(packet, packet_len, force_continue)
end
if o.ip_p == IPPROTO_TCP then
if not o:tcp_parse(force_continue) then
io.write("Error while parsing TCP packet\n")
stdnse.print_debug("Error while parsing TCP packet\n")
end
elseif o.ip_p == IPPROTO_UDP then
if not o:udp_parse(force_continue) then
io.write("Error while parsing UDP packet\n")
stdnse.print_debug("Error while parsing UDP packet\n")
end
elseif o.ip_p == IPPROTO_ICMP then
if not o:icmp_parse(force_continue) then
io.write("Error while parsing ICMP packet\n")
stdnse.print_debug("Error while parsing ICMP packet\n")
end
end
return o