Avoid polluting the syslog with messages regarding
mcastmngr crashing:
procd: Instance mcast::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
Corrected the read_mcast_stats function, to display
"ubus call mcast stats" correct output for multiple iptv bridges
Test:
"ubus call mcast stats" showing correct output for both single and multiple bridge.
the library script that converts uci to mcproxy config is generating
incorrect config for filtering ip addresses which leads to mcproxy
not even starting when multiple filters are defined.
this commit fixes the above described issue.
We need to flush the mdb entries when configuring multicast
snooping on Airoha.
This commit fixes a bug where blocking multicast snooping doesn't
work.
Problem description:
Multiple device section name fetched due
to wild card grep command.
Fix: modified grep command which gets exact device
section name based on device name.
This commit fixes the bug in the uci-default script due to which
the upstream interface in the proxy section was getting overwritten
on sysupgrades.
The uci-default scripts now validates that if the interface that
is set as the upstream_interface is a valid interface in the network
uci file, then config does not need to be updated.
* snooping on bridge interfaces should be changed to disable when
igmp proxy has been disabled.
* updated the function __device_is_bridge() that read the device
section of network config. "grep name=.*$device" was resulting into
matching of ifname option as well that was resulting in a two line
output and causing error while using the output in uci command later.
l2 snooping mode implements on the linux kernel multicast bridge level.
If snooping mode is enabled, mcastmngr configure kernel multicast bridge
with the appropriate uci mcast params.
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.
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'
Fixed worng temp_igmp_file variable accessing, which caused the same
'temp_igmp_file' file to be used each time 'ubus call mcast stats'
was called instead of /tmp/igmp_stats_<PID> file.
Because of this, temp file was sometimes overwritten by the next call
before it had time to read and the IPTV_IGMP_4-12-1-24_2401.py test
ended with an error.
A waiting loop has also been added so that mcproxy has time to process
the signal and write the dump to a file.
Setting '/proc/sys/net/ipv4/igmp_max_memberships' is not enough.
We must pass the max_groups parameter to the mcproxy to prevent MFC
entries from being added to mr_table and packet forwarding for extra
groups.
We also need to increase max_groups, since mcproxy always subscribe
two service groups - ALL-ROUTERS (224.0.0.2) and
ALL-IGMPv3-MC-ROUTERS (224.0.0.22).
Setting '/proc/sys/net/ipv4/igmp_max_memberships' is not enough.
We must pass the max_groups parameter to the mcproxy to prevent MFC
entries from being added to mr_table and packet forwarding for extra
groups.
We also need to increase max_groups, since mcproxy always subscribe
two service groups - ALL-ROUTERS (224.0.0.2) and
ALL-IGMPv3-MC-ROUTERS (224.0.0.22).
Script for generating mcast stats is moved from common to platform
specific files. The logic for generating mcast stats on non broadcom
platforms is different and the stats format is also different.
For generating stats we are are sending SIGUSR1 signal to mcproxy
process which then writes multicast stats to /tmp/igmp_snooping_stats.
service_stop is a legacy function and it should never be used with
procd services which are automatically stopped by /etc/rc.common
Also remove unnecessary boot() which just runs the "start" function.