-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
net: base IPV6_V6ONLY behaviour also on bindv6only (on linux) #12579
Comments
I note also that the net.Listen documentation sucks: http://golang.org/pkg/net/#Listen
Where the |
With The |
I don't think we should change the default behaviors here at this point. Explicit opt-in to a different behavior is fine, but that already exists: use tcp4 or tcp6. |
Would it be possible to change the behaviour of
tcp + "[::]"
andtcp + "0.0.0.0"
on linux based on the value of/proc/sys/net/ipv6/bindv6only
?E.g.
net.Listen("tcp",[::]:3000)
andnet.Listen("tcp",0.0.0.0:3000)
now listen both on IPv4 and IPv6.This may not be the behaviour an administrator expects.
If he has bindv6only enabled it should only listen on IPv6. Otherwise it may create a security risk, especially when using
http.ListenAndServe
where you can not specify a network.Maybe
net.probeIPv6Stack()
can be extended to check for the bindv6only value on linux?The text was updated successfully, but these errors were encountered: