Skip to content

Set Socket interface using interface index #458

Open
@jorritolthuis

Description

@jorritolthuis

In C, one can set a socket's interface using setsockopt(socket, SOL_IP, IP_MULTICAST_IF, &mreqn, sizeof(mreqn)) where mreqn is

struct ip_mreqn {
    struct in_addr imr_multiaddr; /* IP multicast group address */
    struct in_addr imr_address;   /* IP address of local interface */
    int            imr_ifindex;   /* interface index */
};

sockets2 offers the set_multicast_if_v4 function, but only accepts an address as parameter. I would like to set the interface using sockets2 based on an interface index.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions