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 jagdeep sidhu committed Jul 19, 2022
1 parent ae7bb40 commit d314294
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 d314294

Please sign in to comment.