'Why is IP_MULTICAST_IF and IPV6_MULTICAST_IF needed?

Say for example, my machine is multi-homed and has two network interfaces:

  1. Wireless LAN adapter WiFi : Ip: 10.20.19.140
  2. Ethernet adapter Ethernet: Ip: 10.20.19.154

I create two UDP sockets one listening on (1) and other on (2). The i am assuming the interface is already assigned, then why do i need IP_MULTICAST_IF and IPV6_MULTICAST_IF?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source