Skip to content

Commit 65e8bf3

Browse files
committed
net_udp: set IPV6_MULTICAST_IF only of not default
macOS fails on it otherwise (at least 15.0), although it shouldn't according to man ip6(4) (that is, however, presumably inherited from BSD, because FreeBSD has the same).
1 parent b99c8c1 commit 65e8bf3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/rtp/net_udp.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,13 @@ static bool udp_join_mcast_grp6(struct in6_addr sin6_addr, int rx_fd, int tx_fd,
507507
} else {
508508
MSG(WARNING, "Using multicast but not setting TTL.\n");
509509
}
510-
if (SETSOCKOPT(tx_fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
511-
(char *)&ifindex, sizeof(ifindex)) != 0) {
512-
socket_error("setsockopt IPV6_MULTICAST_IF");
513-
return false;
510+
if (ifindex != 0) {
511+
if (SETSOCKOPT(tx_fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
512+
(char *) &ifindex,
513+
sizeof(ifindex)) != 0) {
514+
socket_error("setsockopt IPV6_MULTICAST_IF");
515+
return false;
516+
}
514517
}
515518
}
516519

0 commit comments

Comments
 (0)