jhelovuo / RustDDS

Rust implementation of Data Distribution Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

一个网卡多个IP地址时,组播监听失败

lujfsd opened this issue · comments

我有一个网卡,给了两个IP地址,如下图:

image
在第二个网卡(eth0:1)加入组播时,加入失败,返回错误。why not continue?

    for multicast_if_ipaddr in get_local_multicast_ip_addrs()? {
      match multicast_if_ipaddr {
        IpAddr::V4(a) => {
          mio_socket.join_multicast_v4(&multicast_group, &a)?;
        }
        IpAddr::V6(_a) => error!("UDPListener::new_multicast() not implemented for IpV6"), // TODO
      }
    }

Thank you for the patch.

The reason for this error handling behaviour was that probably no-one had ever tested with an interface with multiple addresses.