#213 strict sequence verification

This commit is contained in:
Mikayla
2023-04-21 21:10:15 +00:00
parent c75f08a9f7
commit 783c4936cc
15 changed files with 16 additions and 16 deletions

View File

@@ -782,7 +782,7 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
-- check sequence number
if self.r_seq_num == nil then
self.r_seq_num = packet.scada_frame.seq_num()
elseif self.linked and self.r_seq_num >= packet.scada_frame.seq_num() then
elseif self.linked and ((self.r_seq_num + 1) ~= packet.scada_frame.seq_num()) then
log.warning("sequence out-of-order: last = " .. self.r_seq_num .. ", new = " .. packet.scada_frame.seq_num())
return
else

View File

@@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.1.15"
local R_PLC_VERSION = "v1.1.16"
local println = util.println
local println_ts = util.println_ts