Skip to content

Conversation

sipa
Copy link
Member

@sipa sipa commented Apr 1, 2012

This will make bitcoin relay valid routable IPv6 addresses, and when USE_IPV6 is enabled, listen on IPv6 interfaces and attempt connections to IPv6 addresses.

@Diapolo
Copy link

Diapolo commented Apr 2, 2012

I can't really comment on your code changes, but I'm interested in some of the changes. You removed / changed how the global var addrLocalHost worked. There is now a list / an array which holds all local addresses, which can be used for bitcoin network connections. That one can be queried via GetLocal(), right? I understand this is needed for IPv6, but could that be used if a client had more than 1 NIC with internet connection, too?

Is IPv6 external address detection possible like with IPv4 or is there a new mechanism in the protocol?

@sipa
Copy link
Member Author

sipa commented Apr 2, 2012

@Diapolo: yes you can use it with multiple NICs; it's even in a separate commit named "Support for multiple local addresses".

IPv6 external address detection works the same way as IPv4, though IRC and whatismyip.com will obviously only tell you about IPv4 addresses.

@Diapolo
Copy link

Diapolo commented Apr 2, 2012

Thanks for the infos @sipa. How would I query or list all interfaces that are used for connections, is this possible with a single GetLocal() call somehow?

@sipa
Copy link
Member Author

sipa commented Apr 2, 2012

GetLocal() queries the mapLocalAddress database; this contains the routable addresses detected on local interfaces, but also addresses discovered through UPnP, IRC, website lookups, or manually specified. There's not really a way to link them back to interfaces anymore (though you can find those in debug.log, lines of the form "ipv4 eth0: 192.168.1.1").

@Diapolo
Copy link

Diapolo commented Apr 2, 2012

I'm asking, because I have a small commit in the pipe, which displays the external IP as a tooltip when you hover the connection symbol in the Qt client. This would get broken by your commit and I wanted to know if I could make it work again (if it ever get's accepted - but it would be an added value to the GUI).

To query all used IPs via a foreach or sth. like that would be nice.

@sipa
Copy link
Member Author

sipa commented Apr 2, 2012

You can query which potentially local addresses bitcoin knows about (just check the mapLocalAddress), but that is not the same as the addresses it's reachable on (no way to know that for sure) or the address of local interfaces.

Edit: you could just use GetLocal(addrBest, NULL), which will return the most likely publicly reachable address.

@luke-jr
Copy link
Member

luke-jr commented Apr 10, 2012

Needs rebasing. Sipa broke everything using locks. >_<

@sipa
Copy link
Member Author

sipa commented Apr 10, 2012

Yeah, I'm a lock breaker. Rebased.

@@ -62,6 +62,12 @@ contains(USE_DBUS, 1) {
QT += dbus
}

# use: qmake "USE_IPV6=1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should IPv6 be disabled by default for Bitcoin-Qt? :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, note that USE_* flags currently represent optional dependencies. I'm not sure IPv6 is a dependency, just a feature?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intended it to be disabled by default everywhere, but at least it should be consistent.

@Diapolo
Copy link

Diapolo commented Apr 10, 2012

I'm sure IPv6 support is one of the biggest infrastructure things in the "Internet" ... would it perhaps be a good idea to offer an IPv6 enabled beta instead of merging directly into master? That's no NACK btw!

@luke-jr
Copy link
Member

luke-jr commented Apr 10, 2012

IPv6 is basically deployed by now. Even in the rare cases of ISPs behind the times or ancient routers, Windows will still setup a Teredo tunnel and Linux users can trivially configure 6to4.

@sipa
Copy link
Member Author

sipa commented Apr 10, 2012

Ok, updated.

  • Foreign addresses (ipv6 when you are ipv4-only, for example) are now not stored in addrman, and only relayed to one node instead of 2.
  • USE_IPV6 is enabled by default by all makefiles

@sipa
Copy link
Member Author

sipa commented Apr 10, 2012

as soon as support for tor/i2p hidden services is added, you'll probably need -externalip=something.onion to make your node advertize that address as well. It seems a bit strange to limit the function to IPv4 when the semantics are exactly the same for every network.

@jgarzik
Copy link
Contributor

jgarzik commented Apr 10, 2012

ACK

@sipa
Copy link
Member Author

sipa commented Apr 10, 2012

Socks version is now selectable using -socks=.

@jgarzik
Copy link
Contributor

jgarzik commented Apr 23, 2012

I would like to merge this sooner rather than later... we can always merge this with !USE_IPV6 for 0.6.1, for example, and then turn on USE_IPV6 on 0.7.

@sipa
Copy link
Member Author

sipa commented Apr 23, 2012

I just split off the SOCKS-related changes to another pullreq.

@rebroad
Copy link
Contributor

rebroad commented Apr 28, 2012

is the -externalip=blahblah.onion working yet?

@sipa
Copy link
Member Author

sipa commented Apr 28, 2012

No, that requires onioncat-style IPv6 addresses support.

@sipa sipa mentioned this pull request May 1, 2012
sipa added 8 commits May 11, 2012 15:29
This will make bitcoin relay valid routable IPv6 addresses, and when
USE_IPV6 is enabled, listen on IPv6 interfaces and attempt connections
to IPv6 addresses.
There are plans to let Bitcoin function as Tor/I2P hidden service.
To do so, we could use the established encoding provided by OnionCat
and GarliCat (without actually using those tools) to embed Tor/I2P
addresses in IPv6.

This patch makes these addresses considered routable, so they can
travel over the Bitcoin network in 'addr' messages. This will hopefully
make it easier to deploy real hidden service support later.
Introduce a boolean variable for each "network" (ipv4, ipv6, tor, i2p),
and track whether we are likely to able to connect to it. Addresses in
"addr" messages outside of our network get limited relaying and are not
stored in addrman.
@sipa
Copy link
Member Author

sipa commented May 11, 2012

Added -bind=[addr].

@luke-jr
Copy link
Member

luke-jr commented May 11, 2012

FWIW, I don't seem to be getting any IPv6 connections with this

@sipa
Copy link
Member Author

sipa commented May 11, 2012

@luke-jr how do you mean?

@luke-jr
Copy link
Member

luke-jr commented May 11, 2012

I mean, I expect running with this should get me at least a few IPv6 connections..?

@jgarzik
Copy link
Contributor

jgarzik commented May 11, 2012

You're probably the only one besides sipa running an IPv6 node, so connection success seems doubtful

@rebroad
Copy link
Contributor

rebroad commented May 11, 2012

I'm running this also, and I think I have IPv6 enabled.

sipa added a commit that referenced this pull request May 12, 2012
@sipa sipa merged commit a387887 into bitcoin:master May 12, 2012
coblee referenced this pull request in litecoin-project/litecoin Jul 17, 2012
@sipa sipa deleted the ipv6 branch June 23, 2017 00:40
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
ptschip pushed a commit to ptschip/bitcoin that referenced this pull request Apr 5, 2018
control which config params add to bitcoin.conf
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Oct 30, 2019
a3dea2f [CMake] Search for and include system includes dir containing endian.h (Fuzzbawls)
675ae85 Update `crypto/common.h` functions to use compat endian header (Fuzzbawls)

Pull request description:

  instead of using the ambiguous `endian.h` header include in `crypto/common.h`, specify our in-tree intermediary header. At the same time, make use of `config/pivx-config.h` and fixup the CMake builds on linux that previously used forced defines.

ACKs for top commit:
  random-zebra:
    ACK a3dea2f
  furszy:
    utACK [a3dea2f](PIVX-Project@a3dea2f)

Tree-SHA512: 6c82890a574c8c5ebb3e16503840dea692589697e24f0101df97ccb31641b2931f663afbbfff6134d6dd7a5e39165acba23490f009fc63341c66d986daa8660e
ajtowns added a commit to ajtowns/bitcoin that referenced this pull request Oct 21, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants