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: ipv4-onlly socket options cannot be applied to AF_INET6 w/ IPV6_V6ONLY=0 socket #8329
Labels
Comments
The difference between the two tests is that ListenUDP both creates the socket and calls Bind to listen to the given address (":1025"). The TestSyscalls version is not doing the Bind. They are not comparable. If you need a special socket option before bind, the easiest way to do that is to create the socket yourself, following the code in TestSyscall (but adding a Bind), and then call net.FileConn(os.NewFile(fd)) to get a net.Conn for it. Note that calling the File method on a net.Conn puts it in blocking mode, which will limit your scalability. So creating the socket yourself is probably the best option anyway. Status changed to Unfortunate. |
Comment 3 by omrib@everything.me: What I was trying to show is that the bug is caused because we're calling bind() before the setsockopt(). You can't use Setsockopt() on sockets created with the standard library on Mac (because the socket object is returned after a call to bind()). As for the new bug status, what does "Unfortunate" status mean? |
perhaps, it might be an api design flaw but we think that trying to control address family A protocol stack by using address family B control knob (e.g., consumer, i mean normal, socket, routing socket, sysctl, blah blah) is waste of time. also this functionality is not supported on BSD variants. what synchronicity! see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193246. in this case you made an AF_INET6 w/ IPV6_ONLY=0 socket using ListenUDP because you passed "udp". A simple fix would be; s/ListenUDP("udp"/ListenUDP("udp4"/ fwiw: http://godoc.org/code.google.com/p/go.net/ipv4 http://godoc.org/code.google.com/p/go.net/ipv6 Labels changed: removed release-go1.4. Status changed to Invalid. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by omrib@everything.me:
The text was updated successfully, but these errors were encountered: