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: UDP multicast crosstalk when listeners use the same port #3820
Labels
Milestone
Comments
As mentioned in several places, listening to a group address, bind to a group address doesn't make sense except for the app want to use bind as kinda traffic filters. We will provide IP-level packet identifying API as a part of IP-level socket options for IPv4 instead. Does this make sense to you? http://golang.org/cl/6482044/ |
This issue was closed by revision golang/net@d2e5a12. Status changed to Fixed. |
Issue #8164 has been merged into this issue. |
This should be reopened. Seriously. go.net/ipv4 and ipv6 don't help here in any kind of way. Function listenDatagram in net/sock_posix.go at line 161 explicitly throws away provided multicast address. Filtering packets in the user space is terribly slower than in kernel when you just bind the socket. At least provide a version of net.ListenUDP that won't play smart and just do what it was told to. |
#9: please open new issue if you really want to have a multicast receiver (usually it cannot send any packet because 5-tuple namespace handling implementations vary on platforms; on some platform it's allowed though) PacketConn. fwiw, you can implement you own multicast receiver PacketConn like the following: s, err := syscall.Socket() lsa := syscall.SockaddrInet4{Port:..., Addr:...} err = syscall.Bind(s, &lsa) f := os.NewFile(uintptr(s), "") c, err := net.FilePacketConn(f) p := ipv4.NewPacketConn(c) p.JoinGroup(...) |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by andrew.w.deane:
Attachments:
The text was updated successfully, but these errors were encountered: