1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-18 01:07:40 +00:00

modem packet validation

This commit is contained in:
kepler155c@gmail.com
2018-11-09 15:27:13 -05:00
parent 68ee419d83
commit 10a0c3a724
2 changed files with 7 additions and 1 deletions

View File

@@ -128,6 +128,7 @@ function Socket.connect(host, port)
local e, id, sport, dport, msg = os.pullEvent()
if e == 'modem_message' and
sport == socket.sport and
type(msg) == 'table' and
msg.dhost == socket.shost then
os.cancelTimer(timerId)
@@ -183,7 +184,8 @@ function Socket.server(port)
local _, _, sport, dport, msg = os.pullEvent('modem_message')
if sport == port and
msg and type(msg) == 'table' and
msg and
type(msg) == 'table' and
msg.dhost == os.getComputerID() and
msg.type == 'OPEN' then