Tribler/dispersy — pull request #132 by boudewijn-tribler (2013-10-08 12:23:32+00:00)
Title: LAN / WAN detection cleanup

Below is a list with the changes, all other commits contain bug fixes, cleanup, and unit tests.

The performance/behavior of peers on the DAS 2 (see: http://jenkins.tribler.org/job/Test_community_walking_NAT) does not appear to change.

Fixes a bug on the DAS4 where very rarely peers are unable to send messages to each other.

- Dispersy._local_interfaces contains a list with all available
interfaces, including their subnet mask

- Votes for our WAN address that originate from within our LAN are
ignored. A vote originates from within our LAN when the origin
sock_addr matches any of Dispersy._local_interfaces, taking into
account the subnet mask of each interface.

- Dispersy.estimate_lan_and_wan_addresses has been simplified. It now
recognises the inability to determine the WAN address of someone who
is on its LAN address (or the LAN address of someone who is on its WAN
address).

- Candidate.lan_address and Candidate.wan_address is now allowed to
be (0.0.0.0, 0). Previously the value would always be set to -some-
address, sometimes resulting in incorrect addresses.

- Candidate.sock_addr is always used when sending packets to a
Candidate. The Candidate.get_destination_address method is
deprecated.