79262837

Date: 2024-12-08 16:18:09
Score: 1
Natty:
Report link

if use bind(the source ip is known),or if use connect socket:

With a static route, with IP_MULTICAST_IF, the multicast IP datagram is sent in a unicast Ethernet frame to the gateway.

With a static route, without IP_MULTICAST_IF, the multicast IP datagram is sent in a multicast Ethernet frame.

if use unconnect socket(without first bind):

With a static route,the multicast IP datagram is always sent in a unicast Ethernet frame, with or without IP_MULTICAST_IF.

So don't use static multicast routes. Stick with setting IP_MULTICAST_IF.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: shixudong