Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

fix: simplify address replacement #102

Merged
merged 1 commit into from Feb 25, 2021
Merged

fix: simplify address replacement #102

merged 1 commit into from Feb 25, 2021

Conversation

Stebalien
Copy link
Member

We only ever want to dial the remote peer's observed address (to prevent DoS attacks), so we might as well always replace the reported addresses with the observed address.

This also fixes a few issues in the original PR:

  • Simpler logic.
  • Replaces the reported address's IP address, not the observed addresses port. This is what we actually care about and allows us to, e.g., dial a UDP address even if the observed address is a TCP address.
  • Won't accidentally dial "skipped" protocols (e.g., circuit transport).

We only ever want to dial the remote peer's observed address (to prevent
DoS attacks), so we might as well _always_ replace the reported
addresses with the observed address.

This also fixes a few issues in the original PR:

* Simpler logic.
* Replaces the IP address, not the port. That's what we actually care about.
* Won't accidentally dial "skipped" protocols (e.g., circuit transport).
@Stebalien Stebalien merged commit a107453 into master Feb 25, 2021
@Stebalien Stebalien mentioned this pull request May 11, 2021
27 tasks
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants