Skip to content

Active RTSP probe can target the TV's home-network address instead of its P2P address #85

Description

@IlyaP358

Reported by @Bibergoahead in #79. When a TV is connected both to the home network and to our P2P group, and it uses the same MAC on both, the active probe can pick the wrong address:

[FluxCast WFD RTSP] Active probe: TV=192.168.178.54; connecting to RTSP port 7236...

while ip neigh had the right one all along:

10.42.0.182      dev p2p-wlan0-3
192.168.178.54   dev wlan0

Cause: _get_peer_ip_from_arp in src/wfd.py scans the whole neighbour table and matches on MAC with no interface filter, so whichever line comes first wins. Ordering is not guaranteed, which is why it only shows up sometimes. It also means that while P2P DHCP is still running, we probe the home-network address instead of waiting for the P2P one.

Fix: only accept neighbours on the p2p-* group interface (excluding p2p-dev-*) in that MAC lookup.

Careful with the fallback right below it, _get_peer_ip_from_p2p_iface. That one exists for #44, where LG randomizes its MAC between discovery and connection so the MAC never matches. Adding the interface filter keeps that path intact: the MAC lookup finds nothing and the fallback still resolves the IP. Please verify that case stays working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working wellgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions