WSL icon indicating copy to clipboard operation
WSL copied to clipboard

IP_MULTICAST_IF fails

Open ericeil opened this issue 10 years ago • 11 comments

On rs_preview build 14905:

The following works on Linux, but fails in WSL:

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>

int main(void)
{
    printf("Creating socket\n");
    int s = socket(AF_INET, SOCK_DGRAM, 0);
    if (s < 0)
        err(1, "%d", errno);

    ip_mreqn opt = { .imr_multiaddr = { .s_addr = 0 },
                     .imr_address = { .s_addr = 0 },
                     .imr_ifindex = 0 };

    if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &opt, sizeof(opt)) != 0)
        err(1, "%d", errno);

    printf("Success!\n");
    return 0;
}

.NET Core has support for setting the multicast interface by either address or interface index, so this impacts .NET Core functionality.

ericeil avatar Aug 25 '16 23:08 ericeil

Thanks @ericeil for reporting this. We already have a task tracking the work required for supporting 'IP_MULTICAST_IF'. We don't have an ETA at the moment.

sunilmut avatar Aug 29 '16 20:08 sunilmut

I would like to bump this as well - running into exactly this issue running https://github.com/UltraMessaging

ankitkk avatar Oct 06 '16 18:10 ankitkk

@ankitkk Don't worry, @ericeil is a Microsoft developer who is developing .net core. This is probably already a priority.

fpqc avatar Oct 06 '16 18:10 fpqc

@sunilmut Is there anything new about this one. Thanks for the hard work.

makpac avatar Feb 12 '17 18:02 makpac

@makpac - Apologize for the delayed response.

Is there anything new about this one.

No, not yet. It's in the pending list. Just curious, is this blocking any scenario for you?

sunilmut avatar Mar 01 '17 19:03 sunilmut

@sunilmut, I tried to install and run a server app which use multicast to talk to its clients and it sets IP_MULTICAST_IF as a socket option. It's not a blocking me as ended up installing it on a VM but being able to run the app on the same machine and without using VMs would be super cool. :)

makpac avatar Mar 02 '17 13:03 makpac

Just an update that support for IP_MULTICAST_IF and IPV6_MULTICAST_IF has been checked in the dev branch and should soon make it to the release branch.

sunilmut avatar Mar 17 '17 20:03 sunilmut

Hello All, I am unable to enable multicast when running ifconfig eth2 multicast on insider preview build 16170. @sunilmut, when you say it has been checked in the dev branch, do you refer to this branch or one that has not been released yet ? Thank you.

ghost avatar Apr 11 '17 19:04 ghost

@bbidault2 - Yes. If you keep an eye out on our release notes, we usually publish what's available in an Insider build. We are a bit slow in getting the release notes out for this release, will have it out soon. Apologize for the delay.

Regarding the support for 'IP_MULTICAST_IF', it should come out soon.

Thanks for trying WSL!

sunilmut avatar Apr 11 '17 20:04 sunilmut

Here is the release note for build 16170. Thanks @jackchammons

sunilmut avatar Apr 11 '17 21:04 sunilmut

This should be fixed in Insider build 16176.

sunilmut avatar Apr 19 '17 17:04 sunilmut