p2p/discover: require table nodes to have an IP (#21330)
This fixes a corner case in discv5. The issue cannot happen in discv4 because it performs IP checks on all incoming node information.
This commit is contained in:
@ -520,6 +520,9 @@ func (tab *Table) delete(node *node) {
|
||||
}
|
||||
|
||||
func (tab *Table) addIP(b *bucket, ip net.IP) bool {
|
||||
if len(ip) == 0 {
|
||||
return false // Nodes without IP cannot be added.
|
||||
}
|
||||
if netutil.IsLAN(ip) {
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user