* 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.
The handling of ifup event in case of snooping config was missing.
Note: ifup event is generated only for l3 interface, so, say ethx is
member of br-y which has proto none. In this case if ethx link goes
down and comes up again, IPTV will not work without a mcast reload.
From the look of it this will be the case in old version as well and
at the moment I don't know how this can be handled but considering this
is a remote scenario in my opinion I don't think the risk is too high.
I would continue to look for a solution ofcourse.
Modifying the lookup method for forwarding multicast packets enables
forwarding on both tagged and untagged upstream interfaces.
I have tested:
- forwarding of traffic in untagged interface.
- forwarding of traffic on tagged interface.
- response to queries in above scenarios by upstream server.
- forwarding of unsolicited joins and leaves to upstream server.
I cannot see a fault at the moment
- Default filter value updated as per requirements.
- Logic added to modify filter ip address as accepted in /var/mcpd.conf
in broadcom.sh
Noticed one hard coding in qos, fixed that too.
In the default config that is generated by the mcast manager,
after support for MLD config via bbf was added the name of section
was updated. This caused unwanted behaviour when config addition
were made by the bbf on top of default config. Updated the default
config igmp snooping section name to resolve that.
The option max_groups is not really needed in the uci, hence,
removed. Also, max_membership and max_msf are set internally
by mcpd so no need to echo them seperately.