threadshare: Fix compatibility with getifaddrs 0.5

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2515>
This commit is contained in:
L. E. Segovia 2025-08-28 18:54:10 -03:00
parent ac86e0590e
commit 8ba691f085

View file

@ -25,7 +25,6 @@ pub mod imp {
use libc::ip_mreq;
#[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "macos"))]
use std::net::IpAddr;
use std::net::Ipv4Addr;
/// Join multicast address for a given interface.
@ -204,9 +203,12 @@ pub mod imp {
#[cfg(target_os = "macos")]
{
let ip_addr = match iface.address {
IpAddr::V4(ipv4_addr) => ipv4_addr,
IpAddr::V6(_) => return Err(io::Error::other("Interface address is IPv6")),
use getifaddrs::Address;
let ip_addr = match &iface.address {
Address::V4(ifaddr) => ifaddr.address,
Address::V6(_) => return Err(io::Error::other("Interface address is IPv6")),
Address::Mac(_) => return Err(io::Error::other("Interface address is Mac")),
};
let mreq = ip_mreq {