From 243e8703c8967078847cccfb4d52ddd1420ddf9b Mon Sep 17 00:00:00 2001 From: Maximilian Fridrich Date: Thu, 27 Jun 2024 11:05:47 +0200 Subject: [PATCH] multicast: fix receiver for IPv6 (#50) --- modules/multicast/multicast.c | 2 +- modules/multicast/receiver.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/multicast/multicast.c b/modules/multicast/multicast.c index 42e5f8c..7d5ce2e 100644 --- a/modules/multicast/multicast.c +++ b/modules/multicast/multicast.c @@ -649,7 +649,7 @@ static int module_read_config(void) err = conf_apply(conf_cur(), "multicast_listener", module_read_config_handler, &prio); if (err) - warning("Could not parse multicast config from file"); + warning("Could not parse multicast config from file\n"); return err; } diff --git a/modules/multicast/receiver.c b/modules/multicast/receiver.c index 6176e31..e46cb95 100644 --- a/modules/multicast/receiver.c +++ b/modules/multicast/receiver.c @@ -855,7 +855,12 @@ int mcreceiver_alloc(struct sa *addr, uint8_t prio) goto out; } - if (IN_MULTICAST(sa_in(&mcreceiver->addr))) { + if (IN_MULTICAST(sa_in(&mcreceiver->addr)) +#ifdef HAVE_INET6 + || IN6_IS_ADDR_MULTICAST(&mcreceiver->addr.u.in6.sin6_addr)) { +#else + ) { +#endif err = udp_multicast_join((struct udp_sock *) mcreceiver->rtp, &mcreceiver->addr); if (err) {