diff --git a/pocket/pocket.lua b/pocket/pocket.lua index 65ade67..0281e92 100644 --- a/pocket/pocket.lua +++ b/pocket/pocket.lua @@ -234,7 +234,7 @@ function pocket.comms(version, modem, pkt_channel, svr_channel, crd_channel, ran elseif self.connected and ((self.api.r_seq_num + 1) ~= packet.scada_frame.seq_num()) then log.warning("sequence out-of-order (API): last = " .. self.api.r_seq_num .. ", new = " .. packet.scada_frame.seq_num()) return - elseif self.api.linked and (self.api.addr ~= src_addr) then + elseif self.api.linked and (src_addr ~= self.api.addr) then log.debug("received packet from unknown computer " .. src_addr .. " while linked (API expected " .. self.api.addr .. "); channel in use by another system?") return @@ -325,7 +325,7 @@ function pocket.comms(version, modem, pkt_channel, svr_channel, crd_channel, ran elseif self.connected and ((self.sv.r_seq_num + 1) ~= packet.scada_frame.seq_num()) then log.warning("sequence out-of-order (SVR): last = " .. self.sv.r_seq_num .. ", new = " .. packet.scada_frame.seq_num()) return - elseif self.sv.linked and (self.sv.addr ~= src_addr) then + elseif self.sv.linked and (src_addr ~= self.sv.addr) then log.debug("received packet from unknown computer " .. src_addr .. " while linked (SVR expected " .. self.sv.addr .. "); channel in use by another system?") return diff --git a/reactor-plc/plc.lua b/reactor-plc/plc.lua index 4000b00..02e592a 100644 --- a/reactor-plc/plc.lua +++ b/reactor-plc/plc.lua @@ -945,7 +945,7 @@ function plc.comms(id, version, modem, plc_channel, svr_channel, range, reactor, if self.linked then if packet.type == SCADA_MGMT_TYPE.ESTABLISH then -- link request confirmation - if (packet.length == 1) and (self.sv_addr == src_addr) then + if packet.length == 1 then log.debug("received unsolicited establish response") local est_ack = packet.data[1]