Skip to content

Commit

Permalink
p2p/discover: apply netrestrict in discv5 response handler (#25304)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadv authored Jul 15, 2022
1 parent e3df3d3 commit a9ef135
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 a9ef135

Please sign in to comment.