diff --git a/main.go b/main.go index 8170752..07d2562 100644 --- a/main.go +++ b/main.go @@ -89,10 +89,13 @@ func onReceive(addr net.UDPAddr, res *data.ResponseData) { } // Updates nodes if NodeID found - if nodeId != "" { - nodes.Update(nodeId, res) + if len(nodeId) != 12 { + log.Printf("invalid NodeID '%s' from %s", nodeId, addr.String()) + return } + nodes.Update(nodeId, res) + if val := res.Statistics; val != nil && statsDb != nil { statsDb.Add(val) }