mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-20 06:49:27 +00:00
p2p/discover: apply netrestrict in discv5 response handler (#25304)
This commit is contained in:
parent
e3df3d34cf
commit
a9ef135e2d
1 changed files with 3 additions and 0 deletions
|
|
@ -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 {
|
if err := netutil.CheckRelayIP(c.node.IP(), node.IP()); err != nil {
|
||||||
return nil, err
|
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 {
|
if c.node.UDP() <= 1024 {
|
||||||
return nil, errLowPort
|
return nil, errLowPort
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue