[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #12377 [Tor]: get_interface_address6() behaviour iff all interface addresses are internal
#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):
First pass at fixing this, at least for some systems:
https://github.com/Yawning/tor/compare/bug12377_linux
Quirks:
* Because RTM_GETADDR on Linux sux, it has to dump every single address,
of every single interface.
* It will always return the primary address associated with the
interface, not any aliases or non-prefered IPv6 addresses.
* It uses the presence of a default route to determine which interface's
address to return.
* It only works on Linux for obvious reasons.
* It carves out a new AF_NETLINK socket per request, and does blocking
I/O. Not ideal, but probably ok, since this isn't anything critical path,
and something is obviously horrifically broken if the kernel doesn't
respond to the inquiries immediately.
This can be improved one step further, by ripping out the poll driven
address determination code and just having the kernel send events on an
AFN_NETLINK socket, but that's obviously more involved.
TODO: Needs more comments, though how it works should be obvious.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12377#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs