Skip to content

Commit

Permalink
p2p/discover: apply netrestrict in discv5 response handler (ethereum#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hadv authored and blakehhuynh committed Oct 7, 2022
1 parent daf8d7f commit 37d6c75
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions p2p/discover/v5_udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ func (t *UDPv5) verifyResponseNode(c *callV5, r *enr.Record, distances []uint, s
if err := netutil.CheckRelayIP(c.node.IP(), node.IP()); err != nil {
return nil, err
}
if t.netrestrict != nil && !t.netrestrict.Contains(node.IP()) {
return nil, errors.New("not contained in netrestrict list")
}
if c.node.UDP() <= 1024 {
return nil, errLowPort
}
Expand Down

0 comments on commit 37d6c75

Please sign in to comment.