namecoin / electrum-nmc

Namecoin port of Electrum Bitcoin client.
https://www.namecoin.org/
MIT License
29 stars 24 forks source link

IPv6 servers possibly broken on Windows #233

Open JeremyRand opened 4 years ago

JeremyRand commented 4 years ago

@gits7r reported on Matrix/IRC that connecting to IPv6 servers may be broken on Windows in 3.3.9.1. I haven't tried to reproduce this yet.

JeremyRand commented 4 years ago

@gits7r Did you try on other OS's? When it failed on Windows, were you using a SOCKS proxy?

gits7r commented 4 years ago

I have tried without using any SOCKS proxy, direct connection. Did not try on other OS's yet cause I don't have native IPv6 everywhere.

JeremyRand commented 4 years ago

Okay. Unfortunately my ISP doesn't have IPv6 support, so this is going to be hard for me to reproduce/debug.

JeremyRand commented 4 years ago

9b0773cf2bf139eafe4a828c8964461d34ea9e23 appears to be a relevant upstream commit, but we already merged that and it should be in nc3.3.9.1

gits7r commented 4 years ago

This is strange. I have done further digging with Electrum-NMC 3.3.10 and native IPv6.

The thing is, if I connect to a hostname that resolves to both IPv4 and IPv6 (has both A and AAAA records), it will correctly follow the OS settings and prioritize IPv6 over IPv4.

However, if I select an IPv6 address from the list (raw address, not hostname from the servers list) it will not connect. Are we missing something in the code that wrongly parses IPv6 raw addresses?

JeremyRand commented 4 years ago

@gits7r Did you enter the IPv6 address with or without the enclosing brackets? It looks to me like upstream Electrum changed the IPv6 address parsing in master branch (hasn't gotten into a release tag yet), and enclosing brackets were (I think) related to the change.

JeremyRand commented 4 years ago

@gits7r It looks like d430ec4bfc2d4ffb7b43ae63297fa9fa492aac01 and a13344938f0f8308651612efc86921a0e9b97602 from upstream are relevant; they're only in master branch of upstream. I've just cherry-picked them to master-3.3.10; can you check whether it's fixed now?

gits7r commented 4 years ago

@gits7r Did you enter the IPv6 address with or without the enclosing brackets? It looks to me like upstream Electrum changed the IPv6 address parsing in master branch (hasn't gotten into a release tag yet), and enclosing brackets were (I think) related to the change.

This seams like the bug. on the latest released binary 3.3.9.1 i have tried both with and without enclosing brackets -- it still won't connect if I put a raw IPv6 address. I guess the test is irrelevant, since you only merged to master-3.3.10 now. the native IPv6 vm does not have git -- I'll figure out a way to test it. but i am most certainly that is the bug, because if you put hostname that resolves to the same IPv6 address it connects. If you put the IPv6 address directly (with or without enclosing brackets) it won't connect.