[tor-bugs] #12377 [Tor]: get_interface_address6() behaviour iff all interface addresses are internal
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Jan 7 16:43:55 UTC 2015
#12377: get_interface_address6() behaviour iff all interface addresses are internal
-------------------------+-------------------------------------------------
Reporter: rl1987 | Owner:
Type: defect | Status: new
Priority: normal | Milestone: Tor: 0.2.6.x-final
Component: Tor | Version: Tor: unspecified
Resolution: | Keywords: tor-relay 026-triaged-1
Actual Points: | 026-deferrable
Points: | Parent ID: #12376
-------------------------+-------------------------------------------------
Comment (by dgoulet):
According to the comment, it's doing it's job but I'm starting to wonder
if it's actually used right.
{{{
/** Set *<b>addr</b> to the IP address (if any) of whatever interface
* connects to the Internet.
}}}
In connection.c, function {{{client_check_address_changed()}}}, it's used
to get the "last interface ip" (which {{{get_interface_address6()}}}
provides) and see if we've seen it before by looking into
{{{outgoing_addrs}}}.
Let's assume we have eth0 with one public IPv6 address, {{{1::cafe}}}
{{{get_interface_address6()}}} will return that address since it fits the
criteria and is the first valid public IP we see. So {{{outgoing_addrs}}}
is updated with it and we live happily after. Lets add a second public
usable IPv6, {{{2::cafe}}}.
Now calling again {{{get_interface_address6()}}} should return the first
valid one which is {{{1::cafe}}} (considering here alphabetical order)
thus disregarding the new IP and making
{{{client_check_address_changed()}}} failing to notice.
Lots of pieces here, I might be missing a check thus need review :). If
it's true, maybe the solution is to keep a list of all valid IPs of any
usable interface and validate our state that way.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12377#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list