ot-br-posix
ot-br-posix copied to clipboard
OpenThread Border Router - Container runs multiple mDNS stacks
Describe the bug
The container at docker.io/openthread/otbr:latest runs avahi-daemon and mdns resulting in mdns name conflicts.
To Reproduce
- Git commit id:
docker.io/openthread/otbr@sha256:3e46f5096405149aa13da8485f8a9dabb9a3cdaaf3e85f2a89217c116cc0bca2 - IEEE 802.15.4 hardware platform: Raspberry Pi 4 - nrf52840 MDK
- Build steps: Run the OTBR image in host networking mode.
- Network topology: The Pi is connected to a WiFi network
- Verify two stacks are present with
ss -lpntu | grep 5353
ss -lpntu | grep 5353
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("avahi-daemon",pid=118,fd=13))
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("mdnsd",pid=103,fd=6))
udp UNCONN 0 0 [::]:5353 [::]:* users:(("mdnsd",pid=103,fd=7))
udp UNCONN 0 0 [::]:5353 [::]:* users:(("avahi-daemon",pid=118,fd=14))
I'm using the following systemd quadlet to run the container.
[Unit]
Description=OpenThread Border Router Server
After=local-fs.target
[Container]
ContainerName=openthread
HostName=openthread
Exec=-B wlan0 --radio-url 'spinel+hdlc+uart:///dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_F9B3763E293A-if00?uart-baudrate=115200' trel://wlan0
Image=docker.io/openthread/otbr:latest
Network=host
PodmanArgs=--privileged
PodmanArgs=--dns=127.0.0.1
Environment=INFRA_IF_NAME=wlan0
Environment=WEB_GUI=1
Volume=/var/lib/container-data/openthread/thread:/var/lib/thread:Z
Volume=/dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_F9B3763E293A-if00:/dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_F9B3763E293A-if00
[Service]
Restart=on-failure
[Install]
WantedBy=multi-user.target
Expected behavior The container to run and not experience host name conflicts resulting in mDNS withdraws and publishing under new host names.
Console/log output
openthread avahi-daemon[131]: New relevant interface wlan0.IPv4 for mDNS.
openthread avahi-daemon[131]: Joining mDNS multicast group on interface lo.IPv6 with address ::1.
openthread avahi-daemon[131]: New relevant interface lo.IPv6 for mDNS.
openthread avahi-daemon[131]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
openthread avahi-daemon[131]: New relevant interface lo.IPv4 for mDNS.
openthread avahi-daemon[131]: Network interface enumeration completed.
openthread avahi-daemon[131]: Registering new address record for fdb2:2856:e6c:cd7c:da55:1399:472a:fa5d on wlan0.*.
openthread avahi-daemon[131]: Registering new address record for 192.168.101.109 on wlan0.IPv4.
openthread avahi-daemon[131]: Registering new address record for ::1 on lo.*.
openthread avahi-daemon[131]: Registering new address record for 127.0.0.1 on lo.IPv4.
openthread avahi-daemon[131]: Withdrawing address record for fdb2:2856:e6c:cd7c:da55:1399:472a:fa5d on wlan0.
openthread avahi-daemon[131]: Withdrawing address record for 192.168.101.109 on wlan0.
openthread avahi-daemon[131]: Withdrawing address record for ::1 on lo.
openthread avahi-daemon[131]: Host name conflict, retrying with openthread-2
openthread avahi-daemon[131]: Registering new address record for fdb2:2856:e6c:cd7c:da55:1399:472a:fa5d on wlan0.*.
openthread avahi-daemon[131]: Registering new address record for 192.168.101.109 on wlan0.IPv4.
openthread avahi-daemon[131]: Registering new address record for ::1 on lo.*.
openthread avahi-daemon[131]: Registering new address record for 127.0.0.1 on lo.IPv4.
Additional context Add any other context about the problem here. None
** Additional Comments**
It appears mdnsd is the default mdns stack based on the contents of the Dockerfile. Would it be safe to just disable the avahi-daemon from starting by default? I'd be willing to take an attempt at a PR to resolve the issue if this is confirmed as a valid bug.
It appears mdnsd is the default mdns stack based on the contents of the Dockerfile. Would it be safe to just disable the avahi-daemon from starting by default? I'd be willing to take an attempt at a PR to resolve the issue if this is confirmed as a valid bug.
Sounds good to disable avahi in docker. Contributions are welcome!