Skip to content

Commit 4462a15

Browse files
committed
net_udp: fix mcast TTL not set also for IPv6
This fixes the commit 43d1568 (2021-03-29) that added this for both IPv4 and IPv6 but for IPv6 the condition was incorrectly aligned to setsockopt fail, not ttl==-1. Dropped IPv4/IPv6 specification - since we may/will use v4-mapped IPv6 sockets, the word "IPv6" might be confusing if use is using IPv4 mcast addr.
1 parent 49a16a9 commit 4462a15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rtp/net_udp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static bool udp_join_mcast_grp4(unsigned long addr, int rx_fd, int tx_fd, int tt
397397
return false;
398398
}
399399
} else {
400-
log_msg(LOG_LEVEL_WARNING, "Using IPv4 multicast but not setting TTL.\n");
400+
MSG(WARNING, "Using multicast but not setting TTL.\n");
401401
}
402402
if (SETSOCKOPT
403403
(tx_fd, IPPROTO_IP, IP_MULTICAST_IF,
@@ -503,9 +503,9 @@ static bool udp_join_mcast_grp6(struct in6_addr sin6_addr, int rx_fd, int tx_fd,
503503
sizeof(ttl)) != 0) {
504504
socket_error("setsockopt IPV6_MULTICAST_HOPS");
505505
return false;
506-
} else {
507-
log_msg(LOG_LEVEL_WARNING, "Using IPv6 multicast but not setting TTL.\n");
508506
}
507+
} else {
508+
MSG(WARNING, "Using multicast but not setting TTL.\n");
509509
}
510510
if (SETSOCKOPT(tx_fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
511511
(char *)&ifindex, sizeof(ifindex)) != 0) {

0 commit comments

Comments
 (0)