return 0;
}
+static inline int
+udp_ifindex_required( udp_connection_t *uc )
+{
+ if (!uc->multicast)
+ return 0;
+#if defined(PLATFORM_DARWIN)
+ if (uc->ip.ss_family == AF_INET)
+ return 0;
+#endif
+ return 1;
+}
+
static int
udp_get_ifindex( const char *ifname )
{
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
/* Bind to interface */
- ifindex = uc->multicast ? udp_get_ifindex(ifname) : 0;
+ ifindex = udp_ifindex_required(uc) ? udp_get_ifindex(ifname) : 0;
if (ifindex < 0) {
tvherror(subsystem, "%s - could not find interface %s",
name, ifname);
}
/* Bind to interface */
- ifindex = uc->multicast ? udp_get_ifindex(ifname) : 0;
+ ifindex = udp_ifindex_required(uc) ? udp_get_ifindex(ifname) : 0;
if (ifindex < 0) {
tvherror(subsystem, "%s - could not find interface %s",
name, ifname);