Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Restrict port to IPv4 addresses for guards #77

Merged
merged 2 commits into from
Oct 21, 2021
Merged

Conversation

laurent-girod
Copy link
Collaborator

Fix issue #75.

if port_used == port:
return True
return False
return router.or_port == port
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this catches only ports for ipv4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Stem library, this field correspond to the OR port described in the "router" line of a router's description.

From Tor's spec, the format of this line is

"router" nickname address ORPort SOCKSPort DirPort NL

where address must be an IPv4 address in dotted-quad format.

Copy link
Contributor

@cgrigis cgrigis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@laurent-girod laurent-girod merged commit 27d616a into main Oct 21, 2021
@laurent-girod laurent-girod deleted the fix-router-selection branch October 21, 2021 12:47
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.

3 participants