[tor-bugs] #24546 [Core Tor/Tor]: Use tor_addr_is_v4() rather than family, or reject all v6-mapped IPv4 addresses
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Mar 27 03:40:26 UTC 2019
#24546: Use tor_addr_is_v4() rather than family, or reject all v6-mapped IPv4
addresses
-------------------------------------------------+-------------------------
Reporter: teor | Owner: neel
Type: defect | Status:
| needs_revision
Priority: Medium | Milestone: Tor:
| unspecified
Component: Core Tor/Tor | Version: Tor:
| unspecified
Severity: Normal | Resolution:
Keywords: tor-dirauth, ipv6, | Actual Points:
033-triage-20180320, 033-removed-20180320, |
035-triaged-in-20180711, |
040-deferred-20190220 |
Parent ID: | Points: 1
Reviewer: ahf, teor | Sponsor:
| SponsorV-can
-------------------------------------------------+-------------------------
Comment (by teor):
Hi, I saw your comments on the pull request.
Replying to [comment:23 teor]:
> I am concerned about the size of the diff in commit 53ff26b. It changes
over 100 lines. It contains at least one logic error that passed review.
There could be more.
>
> Here are our options for moving forward:
> 1. Use an automated tool like coccinelle to do the changes in 53ff26b.
Then we can verify the output using the tool. We should also turn
tor_addr_is_*() into inline header functions, so they are more efficient.
I can understand that you don't want to use an automated tool. But we
can't review a hundred lines of very similar changes effectively. We've
already missed one mistake even though we did multiple reviews, and there
could be more.
> 2. Delete the function tor_addr_is_v4(), and replace all its uses with
`tor_addr_family(addr) == AF_INET`. There are only 13 uses of
tor_addr_is_v4() in master, so the diff should be much smaller and easier
to review.
>
> I prefer option 2, because we will end up with fewer functions, and less
code complexity. And the overall diff will be smaller.
Would you like to do a new pull request that removes tor_addr_is_v4()?
You could use your existing first and last commits
56ec375359032eee15cbda9a6d5960cdd5a28135 and
1d5c703ec2e2d418180f9cdeba1140b9dbaf730d. Then add a commit that removes
tor_addr_is_v4(), which should only be about 20-30 changed lines.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24546#comment:25>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list