Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#5537 closed defect (fixed)

client_check_address_changed() looks likely to do badly with ipv6 connections

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: ipv6 tor-client
Cc: ln5 Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Clients call client_check_address_changed() on every outgoing connection. This function then does a getsockname() on the socket using a sockaddr_in, and logs a warnings if the getsockname() fails.

Unless I'm missing something fundamental, this will spam users' logs with a bunch of EFAULT errors.

Child Tickets

Change History (5)

comment:1 Changed 9 years ago by nickm

Status: newneeds_review

See branch "bug5537" in my public repository. I hope it's not a duplicate. Linus, do you have time to review this?

comment:2 Changed 9 years ago by ln5

This looks fine. Tested on modern Linux with no IPv4 address and seem to work too.

Good catch.

Actually, it doesn't spam logs because getsockname succeeds, or at
least returns 0. Then ip_out becomes 0.

comment:3 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Okay, this one still looks right to me. Merging it. Thanks for the review!

comment:4 Changed 8 years ago by nickm

Keywords: tor-client added

comment:5 Changed 8 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.