-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default config: listen on IPv6 for the swarm address #1076
Conversation
@zorun have you tested this successfully? Im not sure if this will collide on the TCP port given how we're doing listening (would be separate calls to Listen (bind)) |
And thanks! i'd be in favor of this 👍 :) |
Yes, it does work, at least on Linux (Debian and Archlinux):
Actually, there seems to be some clever code somewhere: IPFS (or Go itself) seems to activate IPV6_V6ONLY (see http://tools.ietf.org/html/rfc3493#section-5.3 ) whenever the IPv4 port is already bound. When listening on IPv6 only (by setting
|
So, to sum things up, as a general rule:
Here, for some reasons, binding both a dual-stack IPv6 socket and an IPv4 socket on the same port works. You're right, maybe it's a good idea to find out why before merging this patch :) |
I realised that I was testing on recent Linux kernels, which allows to bind multiple sockets on the same port ( That being said, I tested again on an older kernel (3.2.0, Debian wheezy, which does not have SO_REUSEPORT), and it works, so Go seems to work this out itself. @jbenet could you test this on other systems, for instance OS X? |
@zorun travis can test both Linux and OSX. it may be useful to add a test case that exercises this, by opening up a swarm with both |
(And, it seems to be working on OSX on my machine.) @zorun will let you decide on the test case. |
@zorun bump on this? would be good to have it merged in next couple of days. |
I looked at the tests, but it looks too obscure for me to write one. Sorry! If it works on Debian and OS X, that's good for me. |
I wonder if we have any esoteric machines to test this with-- im not sure which may fail. once again i look at http://build.golang.org/ with desire. |
I'd like to merge this, but i'm worried it will break hard on older machines. how could we make ourselves sure it won't? or that it will fail gracefully? |
Relevant golang issue: golang/go#9334 |
I submitted a pull request for this exact patch, because I didn't find this one, sorry. Maybe ipfs init should mention a ipfs reconfig that asks questions, or maybe more comments/documentation in ~/.ipfs/config. Specifically include an example for all IPv6 addresses That way reasonable defaults can be chosen, but also make it easier for people to fix things. I still think it's reasonable to enable IPv6 by default. |
@spikebike ah sorry -- forgot this PR existed. Still would like to make sure it's safe. what OSes do we have without IPv6 support? |
and, +1 to the
|
If binding the address fails, but the program continues, then I'm for merging this now. Could we write a test and have someone run it in a system without ip6? |
It's trivial to disable IPv6 on most platforms, on ubuntu: I'm confused by the need for writing a test. Seems like one of two things is going to happen:
If it's #1 we are golden, if it's #2 we should likely setup some kind of interactive configuration that asks the user about IPv4, IPv6, privacy addresses, etc. As soon as I see it merged I'll try it on a ubuntu system with IPv4 only, IPv4+IPv6, and IPv4 + broken IPv6. I don't have any windows or OSX to test though. |
@spikebike i'd rather we try it from the PR branch before it is merged. Many people follow + build from master so i don't want to merge things that will break on people. |
PR = proto-fix branch? Works for me, so @zorun should issue a pull request against that branch then interested parties can test. |
@spikebike no i just mean:
if it checks out, i'll merge this. |
We'll should be able to test this with a docker container |
any news on this? |
@simonvetter i haven't tested this. Would you (or someone else) be able to? |
I've tested with IPv6 enabled and connected (Debian wheezy) and IPv6 both enabled and disabled with no connectivity (Ubuntu 14.04), and I'm not seeing any major problems (other than my usual NAT-related issues). IPFS daemon starts successfully when told to listen on IPv6 even when IPv6 is disabled, and doesn't print any errors. |
@davidar thank you! (Wish we had a test, but oh well. people will complain if this breaks) |
Default config: listen on IPv6 for the swarm address
surprise, found a machine it fails with \o/ -- #1675 |
Ah, I tested with ipv6 disabled via sysctl, but didn't completely unload the kernel module. Sorry @jbenet |
@davidar no worries at all, we gave it a fair shot. we'll fix it next round :) |
Default config: listen on IPv6 for the swarm address
Default config: listen on IPv6 for the swarm address
Default config: listen on IPv6 for the swarm address
No description provided.