To join a multicast the macOS still uses the interface address from the ip_mreq instead of the ip_mreqn unlike other Linux systems. So add a new conditional block for macOS to use ip_mreq for IP_ADD_MEMBERSHIP and ip_mreqn for IP_MULTICAST_IF This is similar to the fix in the glib for multicast join/leave operation on macOS https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4333 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7851>