forked from LBRYCommunity/lbry-sdk
platform ip: ensure daemon retrieves IPv4 address only
When contacting jsonip.com to retrieve the node external IP, the connection might be established with IPv6 and thus return an address belonging to that family. This address is then used to initialize the external_ip member of Daemon session, but unfortunately IPv6 is not yet handled well. Using an IPv6 as external IP is currently breaking parts of the Daemon resulting in no peer connectivity at all. We should stick to IPv4 for time being. http://jsonip.com/about says "ipv4-only":"https://ipv4.jsonip.com" therefore, change the IP retrieval URL to ipv4.jsonip.com to make sure the connection is established only using an IPv4 address. Closes: https://github.com/lbryio/lbry/issues/971 Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
This commit is contained in:
parent
db751eabb6
commit
d827b4d5af
2 changed files with 2 additions and 1 deletions
|
@ -14,6 +14,7 @@ at anytime.
|
|||
|
||||
### Fixed
|
||||
* Fixed amount of close nodes to add to list in case of extension to neighbouring k-buckets
|
||||
* Fixed external IP detection via jsonip.com (avoid detecting IPv6)
|
||||
*
|
||||
|
||||
### Deprecated
|
||||
|
|
|
@ -39,7 +39,7 @@ def get_platform(get_ip=True):
|
|||
|
||||
if get_ip:
|
||||
try:
|
||||
p['ip'] = json.load(urlopen('http://jsonip.com'))['ip']
|
||||
p['ip'] = json.load(urlopen('http://ipv4.jsonip.com'))['ip']
|
||||
except:
|
||||
p['ip'] = "Could not determine IP"
|
||||
|
||||
|
|
Loading…
Reference in a new issue