From 6fb600782fc365c73d99b997973924ed5e3c0b86 Mon Sep 17 00:00:00 2001 From: batrick Date: Wed, 8 Dec 2010 14:08:35 +0000 Subject: [PATCH] Don't use io.write to print error information. --- nselib/packet.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nselib/packet.lua b/nselib/packet.lua index b5fdbc7f6..9e2025366 100644 --- a/nselib/packet.lua +++ b/nselib/packet.lua @@ -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