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 HanWang233 committed Sep 11, 2022
1 parent 504df3d commit 5d1dc8f
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 5d1dc8f

Please sign in to comment.