eProsima / Micro-XRCE-DDS-Agent

Micro XRCE-DDS Agent respository. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
113 stars 81 forks source link

Discovery protocol joins multicast group on wrong interface #359

Open bjsowa opened 9 months ago

bjsowa commented 9 months ago

Steps to reproduce the issue

  1. Make sure at least two interfaces are up with an IPv4 address configured.
  2. Start the agent with the discovery enabled:
    ./MicroXRCEAgent udp4 -p 8888 -d

Expected behavior

I would expect the agent to join the 239.255.0.2 multicast group on all interfaces.

Actual behavior

Running ip maddr shows that the agent joins the multicast group only on the wireless interface.

$ ip maddr
1:      lo
        inet  224.0.0.251
        inet  224.0.0.1
        inet6 ff02::fb
        inet6 ff02::1
        inet6 ff01::1
2:      enp4s0
        link  01:00:5e:00:00:01
        link  33:33:00:00:00:01
        link  33:33:ff:9b:ea:78
        link  33:33:00:00:00:fb
        link  01:00:5e:00:00:fb
        inet  224.0.0.251 users 2
        inet  224.0.0.1
        inet6 ff02::fb
        inet6 ff02::1:ff9b:ea78
        inet6 ff02::1
        inet6 ff01::1
3:      wlp5s0
        link  01:00:5e:00:00:01 users 2
        link  01:00:5e:00:00:fb users 2
        link  33:33:00:00:00:01 users 2
        link  33:33:00:00:00:fb users 2
        link  33:33:ff:bb:f7:a3 users 2
        link  01:00:5e:7f:00:02 users 2
        inet  239.255.0.2
        inet  224.0.0.1
        inet  224.0.0.251 users 3
        inet6 ff02::1:ffbb:f7a3
        inet6 ff02::fb
        inet6 ff02::1
        inet6 ff01::1  

As such, the client that is connected through wired interface is not able to communicate with the agent. If I disable the wireless interface and run the agent again, it joins the multicast group on the wired interface and the client is able to establish communication.