Skip to content

IP_MULTICAST_IF fails #990

@ericeil

Description

@ericeil

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions