i2pd icon indicating copy to clipboard operation
i2pd copied to clipboard

IPv6 and IPv4 auto mode #1965 issue

Open wipedlifepotato opened this issue 1 year ago • 11 comments

wipedlifepotato avatar Sep 07 '23 14:09 wipedlifepotato

[user@computer i2pd]$ ./i2pd --loglevel=debug| grep -i ipv 21:28:07@495/debug - Transports: IPv6 supports is 0 21:28:07@495/debug - Transports: IPv4 supports is 1

[user@computer i2pd]$ cat ~/.i2pd/i2pd.conf ipv4=auto ipv6=auto

i dont have a ipv6 address but this will to works

wipedlifepotato avatar Sep 07 '23 14:09 wipedlifepotato

нужно подключение к ипв6 1 раз делать в методе для проверки брать пиры из netdb часть кода можно удалить

wipedlifepotato avatar Sep 08 '23 05:09 wipedlifepotato

Thread 1 "i2pd" received signal SIGSEGV, Segmentation fault. 0x00000000004d39f0 in i2p::data::RouterInfo::IsNTCP2V6 (this=0x0) at libi2pd/RouterInfo.h:230 230 bool IsNTCP2V6 () const { return m_SupportedTransports & eNTCP2V6; }; (gdb) bt #0 0x00000000004d39f0 in i2p::data::RouterInfo::IsNTCP2V6 (this=0x0) at libi2pd/RouterInfo.h:230 #1 0x00000000004cda26 in operator() (__closure=0x7fffffffd34c) at libi2pd/Config.cpp:539 #2 0x00000000004cdb69 in i2p::config::IsIPv6Works () at libi2pd/Config.cpp:545 #3 0x00000000005a7649 in std::__invoke_impl<bool, bool (*&)()> (__f=@0x7fffffffd4f0: 0x4cdb30 i2p::config::IsIPv6Works()) at /usr/include/c++/13/bits/invoke.h:61

wipedlifepotato avatar Sep 08 '23 07:09 wipedlifepotato

Transports::PeerTest is a more good way

wipedlifepotato avatar Sep 08 '23 07:09 wipedlifepotato

https://github.com/PurpleI2P/i2pd/commit/d0316f5bdd1b1c15b16e2eb863c856e42ed2b12a#diff-e50973d72af06df6214f78b71992c591d5fce3a8198d85ba58713742717d71eeR538 возвращает нуллевой указатель нужно сначала инициализацию сделать но проблема в том что тогда будет циклично вызывать метод нужно обдумать как лучше сделать и гугл запрашивать тоже плохая идея просто к ::1 цеплятся тоже плохая идея проверять по интерфейсам тоже плохая идея

wipedlifepotato avatar Sep 08 '23 08:09 wipedlifepotato

15:32:26@838/debug - Transports: IPv6 supports is 0 15:32:26@838/debug - Transports: IPv4 supports is 0

If do connection to 0.0.0.0/127.0.0.1 then is a bad idea. So only get from netdb maybe run this tests in netdb code need a think

wipedlifepotato avatar Sep 08 '23 08:09 wipedlifepotato

https://github.com/PurpleI2P/i2pd/blob/openssl/libi2pd/Transports.cpp#L669

wipedlifepotato avatar Sep 08 '23 08:09 wipedlifepotato

bool IsIPv4Works(void)
{
       if(! i2p::context.GetTesting () ) return true; // For a test
       auto retVal = i2p::context.GetStatus();
           LogPrint (eLogDebug, "Transports: IPv4 supports is ", retVal);
       return retVal;
}
bool IsIPv6Works(void)
{
       if(! i2p::context.GetTestingV6 () ) return true; // For a test
       auto retVal= i2p::context.GetStatusV6();
           LogPrint (eLogDebug, "Transports: IPv6 supports is ", retVal);
       return retVal;
}

If we do simillar code, then is like to set up "true" always for ipv6

wipedlifepotato avatar Sep 08 '23 08:09 wipedlifepotato

I've tried your latest commit and ./i2pd --loglevel=debug is stuck at no output, with ss -tupn showing tcp SYN-SENT 0 1 [2a02:810d:b5bf:ece1:5054:ff:fea4:e2b8]:51512 [2001:4860:4860::8844]:* users:(("i2pd",pid=10188,fd=6)) . The host I'm trying this on has working IPv6. I have been checking the tcpdump and it looks like you're trying to connect to Google DNS on port 0. I can try to troubleshoot this and let you know if I got a fix, but I sadly don't know much of C++. I think trying port 53 should be better.

86dd avatar Sep 08 '23 12:09 86dd

We can also try to make an http request for ipv4.icanhazip.com and ipv6.icanhazip.com, as that's backed by cloudflare now as it seems.

86dd avatar Sep 08 '23 12:09 86dd

Ok. If you can, you can git clone my repository and pull requests if you dont know how to do it. then it is ok. I can too. Firstly I would like to ask original and r4sas in iRc about our idea. What did you say?

пт, 8 сент. 2023 г. в 19:14, Julia Logan @.***>:

We can also try to make an http request for ipv4.icanhazip.com and ipv6.icanhazip.com, as that's backed by cloudflare now as it seems.

— Reply to this email directly, view it on GitHub https://github.com/PurpleI2P/i2pd/pull/1966#issuecomment-1711575034, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQ663ZHEJI2VWY5OOMUFQ3XZMDY3ANCNFSM6AAAAAA4O7XYMA . You are receiving this because you authored the thread.Message ID: @.***>

wipedlifepotato avatar Sep 08 '23 13:09 wipedlifepotato

I would say that we should try and not rely on some third-party service to be up. I feel like the best solution would be to check the device interfaces and see if we have an IPv4/6 IP address. Someone could have the Google IPv6 DNS servers blocked, but still have IPv6 on the machine.

arthurmelton avatar Mar 24 '24 23:03 arthurmelton

IPv4/6 IP address. Someone

yeap. but what about Yggdrasil address. WIll returns with an another solution. would be just check ipv6 connection from netdb

wipedlifepotato avatar Mar 26 '24 14:03 wipedlifepotato