Check for NodeID length
This commit is contained in:
parent
808135904f
commit
53720c3c57
7
main.go
7
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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue