From de920a2afc5bacb3fa3f8014f131fb79390fc487 Mon Sep 17 00:00:00 2001 From: kroosec Date: Sun, 5 Aug 2012 18:41:42 +0000 Subject: [PATCH] ospf.lua: Couple of bug fixes in ospf packet conversion to raw string. --- nselib/ospf.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nselib/ospf.lua b/nselib/ospf.lua index 39ba99189..269704809 100644 --- a/nselib/ospf.lua +++ b/nselib/ospf.lua @@ -99,7 +99,7 @@ OSPF = { __tostring = function(self) local hdr = bin.pack(">CCS", self.ver, self.type, self.length ) - hdr = hdr .. bin.pack(">IISS", self.router_id, self.area_id, self.chksum, self.auth_type) + hdr = hdr .. bin.pack(">IISS", ipOps.todword(self.router_id), self.area_id, self.chksum, self.auth_type) if self.auth_type == 0x00 then hdr = hdr .. bin.pack(">L", 0x00) elseif self.auth_type == 0x01 then @@ -153,7 +153,7 @@ OSPF = { __tostring = function(self) self.neighbors = self.neighbors or {} local function tostr() - local data = bin.pack(">ISCCIII", self.netmask, self.interval, self.options, self.prio, self.router_dead_interval, self.DR, self.BDR) + local data = bin.pack(">ISCCIII", ipOps.todword(self.netmask), self.interval, self.options, self.prio, self.router_dead_interval, ipOps.todword(self.DR), ipOps.todword(self.BDR)) for _, n in ipairs(self.neighbors) do data = data .. bin.pack("