UDPSink is using wrong socket option for multicast interface (patch)
The UDPSink/MultiUDPSink is using the SO_BINDTODEVICE
option to attempt to limit the multicast interface on which multicast udp streams are output. The correct socket options are IP_MULTICAST_IF
and IPV6_MULTICAST_IF
. The patch referenced below switches the behaviour to using these APIs. This produces correct behaviour (on Linux machines).
Note that the two options require slightly different parameters. The IPv4 API requires the IP address of the local interface to which to limit (we are using bind-address for this, as it appears that was the original intent), while the IPv6 API requires the interface index (we are using multicast-iface for this). I've tried to make the property documentation a bit clearer on that.
I'm unsure if the headers/socket functions I'm introducing are available on Windows or Mac, so that should be reviewed by someone more knowledgeable about such thing. On Linux both IPv4 and IPv6 variants are shown to correctly limit output to specified interfaces.
https://github.com/ATX-Networks/gst-plugins-good/commit/e85e8eab93228e76d57966397634c0ae28b93278
Hope this helps, Mike