mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-06 20:53:00 -05:00
WSDiscovery::TransportUDP::send_multi opened its socket with PeerAddr, which connects it, and called mcast_if afterwards. A connected UDP socket keeps the route chosen at connect time, so on a host with more than one network the Probe left through the default route whatever interface was chosen: the web UI's ONVIF probe (zmonvif-probe.pl probe <version> <interface>) found no camera on a second network. Open the socket unconnected, set mcast_if first, and send to the group with mcast_send. The destination is passed as a packed sockaddr_in: given as "addr:port", mcast_send in IO::Socket::Multicast 1.12 (Debian trixie) ends up with port 0 and the send fails with EINVAL. Without an interface nothing changes: the probe goes out the default route as before. tests/perl/test_wsdiscovery_mcast_if.pl records the socket calls and checks the order and the destination. fixes #5256 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>