#22 closed defect (fixed)
can't use it behind firewalls -- 'local_ip' file handling is broken
Reported by: | warner | Owned by: | somebody |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | code | Version: | |
Keywords: | Cc: | ||
Launchpad Bug: |
Description
the node-setup code, left to its own devices, will determine a list of all of the IP addresses that its host is using (through /sbin/ifconfig on unix), and put all of them into the "connection hints" field of the FURL that it passes to the introducer. This includes 127.0.0.1 (for the benefit of any nodes that happen to be running on the same machine).
When a node is living behind a NAT box on which the user has configured a port forwarding, it is useful to inform the node that there are other IP addresses which should be advertised. The "local_ip" file is intended for this purpose: the idea is to put these additional IP addresses in the file, and at node startup time those addresses will be added to the list computed by ifconfig. (note that it is no problem for the FURL to contain too many addresses: foolscap will attempt to establish connections to all of them, and whichever one achieves negotiation first will win).
Unfortunately, the code that handles local_ip (source:src/allmydata/node.py Node._setup_tub) is somewhat broken. It should probably read a list of hostname:portnum (or ipaddr:portnum) lines from the file, strip and split and int(portnum)-ify each one, then append them to local list (the same local list that has the addresses from get_local_addresses). The local list is then used to create the connection hints for the Tub.
The existing code is at the very least missing a strip(), so that the local_ip file would need to lack a trailing newline for this to work (which is a nuisance to work with). It should also accept multiple addresses, one per line. It should also accept either a bare address or an address:portnum pair, to allow the user to, e.g., forward visiblehost.org:1234 to internalhost:7889 .
Also, the use of the 'local_ip' file needs to be documented somewhere.
Change History (3)
comment:1 Changed at 2007-05-07T02:46:21Z by zooko
- Priority changed from minor to critical
- Summary changed from 'local_ip' file handling is broken to can't use it behind firewalls -- 'local_ip' file handling is broken
comment:2 Changed at 2007-05-23T23:40:18Z by arch_o_median
- Resolution set to fixed
- Status changed from new to closed
comment:3 Changed at 2007-05-25T22:38:27Z by zooko
fixed as of 44902c51522839ed
Raising the priority level to remind myself that this interferes with my desire to use tahoe with a few of my friends to backup and share our stuff.