get_interface_address6() in src/common/address.c finds out the IP address of the internet-facing interface. This can be useful to controllers like arm which can use the IP address for setting up port-forwarding.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
/** Set *<b>addr</b> to the IP address (if any) of whatever interface * connects to the Internet. This address should only be used in checking * whether our address has changed. Return 0 on success, -1 on failure. */intget_interface_address6(int severity, sa_family_t family, tor_addr_t *addr)
I'm not exposing this function to the control port if its result ‘should only be used in checking whether our address has changed’.
I re-did the get_interface_address6() part in arm so it sounds okay if it's not exposed. Vidalia doesn't need it right now anyway (it relies on miniupnp for port-forwarding).
Trac: Resolution: N/Ato wontfix Status: new to closed
Tor appears to use the result of get_interface_address6 for purposes other than ‘checking whether our address has changed’, so the documentation comment may be wrong. Also:
If the point of this GETINFO item is to let controllers know what Tor currently thinks its address is, we should expose that piece of information to the control port. (That would be even harder for controllers to figure out on their own than what the current implementation of get_interface_address6 would return.)
Once nickm's bug1827 branch is merged, we will have OS-specific methods of finding lists of network interface addresses. Exposing all of those might be useful to a controller.
If the goal is to help controllers set up port forwarding for Tor, perhaps we should expose whatever information Tor passes to tor-fw-helper to the control port.
Do GETINFO net/listeners/or and GETINFO net/listeners/dir help here?
Tor appears to use the result of get_interface_address6 for purposes other than ‘checking whether our address has changed’, so the documentation comment may be wrong. Also:
If the point of this GETINFO item is to let controllers know what Tor currently thinks its address is, we should expose that piece of information to the control port. (That would be even harder for controllers to figure out on their own than what the current implementation of get_interface_address6 would return.)
I think rather that this is a bug in how we use the function currently, it was never intended for something that it later got used for.
Tor already responds to GETINFO address, which outputs address retrieved from router_pick_published_address(), but this may not be an IP address of network interface used by Tor instance if it is running behind NAT.
Should GETINFO address/ipv4 and GETINFO address/ipv6 return address from get_interface_address6() with family parameter being AF_INET and AF_INET6 respectively? Should we leave implementation of GETINFO address as-is, in order to leave opportunity to retrieve published (guessed?) address available to controller?
Vidalia/arm/other controller people, what do you need here?
If you're asking how this ticket originated, krkhan was working on a UPnP feature for arm years back. It was never very reliable and as such wasn't merged. Besides that I don't have any context regarding this ticket.