You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[multicast_dns] IPv4 queries ignore the Wi-Fi interface and leave over cellular when mobile data is up #196244
On IPv4, MDnsClient.start() never sets IP_MULTICAST_IF on its sending socket. For IPv6 it does — the per-interface loop sets RawSocketOption.IPv6MulticastInterface. The IPv4 path calls joinMulticast but sets no IPv4MulticastInterface, so IPv4 multicast egress follows the OS routing table.
On a phone with both Wi-Fi and mobile data up, the default route is cellular, so mDNS queries leave over the cellular interface and never reach the LAN. Discovery silently finds nothing and reports no error.
Evidence
In lib/multicast_dns.dart, the interface loop sets the multicast interface only inside the if (targetAddress.type == InternetAddressType.IPv6) branch. The IPv4 send socket (_incomingIPv4, bound to anyIPv4) joins multicast but is never given an IPv4MulticastInterface option.
Confirmed on desktop that joinMulticast does not set IP_MULTICAST_IF: reading the socket's IPv4MulticastInterface option stays 0.0.0.0 after joining on every interface, so the socket relies on routing for IPv4 egress.
Steps to reproduce
On an Android device, turn on both Wi-Fi and mobile data.
Announce an mDNS service on the LAN from another machine (e.g. dns-sd -R sample _http._tcp . 8000).
Run a lookup from the device. It returns nothing.
Force the socket's IPv4 multicast interface to the Wi-Fi address and repeat — the same lookup resolves.
Suggested fix
In the IPv4 path, set the multicast interface, mirroring the IPv6 branch:
Activity
puneetkukreja98 commentedon Nov 10, 2026
@Marshal-GG Thanks for reporting this, routing this to team-ecosystem for further investigation.
bparrishMines commentedon Nov 10, 2026
cc @vashworth since you are the suggested reviewer.