[tor-bugs] #12377 [Tor]: get_interface_address6() behaviour iff all interface addresses are internal
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Apr 10 23:18:36 UTC 2015
#12377: get_interface_address6() behaviour iff all interface addresses are internal
-------------------------+-------------------------------------------------
Reporter: rl1987 | Owner:
Type: defect | Status: assigned
Priority: normal | Milestone: Tor: 0.2.7.x-final
Component: Tor | Version: Tor: unspecified
Resolution: | Keywords: tor-relay, 026-triaged-1,
Actual Points: | 026-deferrable, 027-triaged-1-out
Points: | Parent ID:
-------------------------+-------------------------------------------------
Comment (by yawning):
This is an example of how to rewrite all of this code, to do the mostly
right thing on Linux (For anything more recent than kernel 2.2 definitions
of "more recent"). This supercedes the `getifaddr` code (which is
broken), and is superior to the UDP trick since it doesn't make a random
UDP socket.
Adapting it to fit into tor is left as an exercise for the student:
https://gist.github.com/Yawning/c70d804d4b8ae78cc698
The same socket type can also be used to have the kernel tell us when the
IP address/routing table changed, which may be useful to some people.
NB: Yes the code is ugly, I sort of threw it together. No I will not do
Darwin or Windows.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12377#comment:16>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list