HomeSource World

p2p: add 0 port check in dialer (#21008)

Description

p2p: add 0 port check in dialer (#21008)

  • p2p: add low port check in dialer

We already have a check like this for UDP ports, add a similar one in
the dialer. This prevents dials to port zero and it's also an extra
layer of protection against spamming HTTP servers.

  • p2p/discover: use errLowPort in v4 code
  • p2p: change port check
  • p2p: add comment
  • p2p/simulations/adapters: ensure assigned port is in all node records

Details

Provenance
Felix Lange <fjl@twurst.com>Authored on May 11 2020, 3:11 PM
GitHub <noreply@github.com>Committed on May 11 2020, 3:11 PM
Parents
rGETH069a7e1f8abe: core/rawdb: stop freezer process as part of freezer.Close() (#21010)
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGETH6f54ae24cdea: p2p: add 0 port check in dialer (#21008) (authored by Felix Lange <fjl@twurst.com>).May 11 2020, 3:11 PM