Skip to content
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

x/net/ipv4: PacketConn.MulticastInterface is implemented incorrectly on Linux #41854

tamird opened this issue Oct 7, 2020 · 3 comments


Copy link

@tamird tamird commented Oct 7, 2020

Per the man page:

       IP_MULTICAST_IF (since Linux 1.2)
              Set the local device for a multicast socket.  The argument for
              setsockopt(2) is an ip_mreqn or (since Linux 3.5) ip_mreq
              structure similar to IP_ADD_MEMBERSHIP, or an in_addr struc‐
              ture.  (The kernel determines which structure is being passed
              based on the size passed in optlen.)  For getsockopt(2), the
              argument is an in_addr structure.

However, the implementation uses the wrong type for retrieval:

Oddly, the default case in getMulticastInterface would do the right thing.

This looks to have been broken in golang/net@353547e

@gopherbot gopherbot added this to the Unreleased milestone Oct 7, 2020
Copy link

@gopherbot gopherbot commented Oct 8, 2020

Change mentions this issue: ipv4: Correctly MulticastInterface on Linux

Copy link

@networkimprov networkimprov commented Oct 8, 2020

Copy link

@dmitshur dmitshur commented Oct 13, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.