Skip to content

mcastmngr: fixed mcproxy crash for multiupstream config

Anatoly Mirin requested to merge mirin/fix_mcastmgr_multiupload into devel

If more than one upstream iface is defined, mcastmngr runs mcproxy multiple times for each protocol (e.g. igmp) with the same config. So second mcproxy process fails because it can't lock the MRT flag (/proc/sys/net/ipv/default/mc_forwarding) already blocked by the first process.

If one good and one bad (no IP address) upstream interfaces are defined, mcastmngr generates wrong filter configuration and mcproxy cannot start at all.

In both cases, such error messages appear in the log:

logread | grep mcast

Fri Jun 30 16:24:24 2023 daemon.info procd: Instance mcast::instance1 s in a crash loop 6 crashes, 2 seconds since last crash

Now upstream and downstream ifaces are checked in the 'config_mcproxy_interfaces' function and only good interfaces (with IP) are written to the mcproxy config. Only one mcproxy process is started per protocol (igmp, mld), configured to handle multiple interfaces if necessary.

'get_network_of' function removed. This function fails in some uci configurations for interfaces that refer to a device indirectly. Example - network.wan6.device='@wan'

Edited by Anatoly Mirin

Merge request reports