Bug 16091 - MulticastInterface int SocketOption not wrapped in ip_mreqn/ip_mreq on linux
Summary: MulticastInterface int SocketOption not wrapped in ip_mreqn/ip_mreq on linux
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-11-10 15:35 UTC by Tom
Modified: 2013-12-06 15:39 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Tom 2013-11-10 15:35:30 UTC
On windows, I use this code to set the MulticastInterface socket option:
Socket socket = ...;
int index = ...;
socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(index));

On linux, I see the index is passed as an int to setsocketopt which returns EADDRNOTAVAIL.
Probably the int should be wrapped in a struct ip_mreqn/ip_mreq (man 7 ip).

Some notes:
* passing a 12 byte array (ip_mreqn size) with the lowest bytes set to the index in network order, works on linux, but not on windows
* MS .NET and mono do not accept a MulticastOption as a MulticastInterface parameter.


Comment 1 Rodrigo Kumpera 2013-12-06 14:59:52 UTC
Can you provide a test case that shows this problem?
Comment 2 Tom 2013-12-06 15:39:12 UTC
This is resolved by https://github.com/mono/mono/commit/3c3e109e599412dc4f3d4c99ef191c4e453d0209