Commit graph

52 commits

Author SHA1 Message Date
Rahul Thakur
3cb3a657d8 mcastmngr: handle multiple filters for mcproxy
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.
2024-09-06 16:21:22 +05:30
Amit Kumar
1d5b6f239f mcastmngr: Handled max multicast snoop entry
* removed +2 logic as multicast snoop entry handled in mcproxy
 with logic to exclude count of reserve mcast ip address subnet
2024-06-10 14:49:37 +05:30
Markus Gothe
061bede64d mcastmngr: Airoha multicast snooping needs to be toggled to work.
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.
2024-05-15 11:14:09 +00:00
Erik Karlsson
58cc602f8f mcastmngr: handle multiple upstream interface sections
Do not overwrite mcast configuration if there are multiple interface
sections referring to the same upstream device such as wan/wan6

(cherry picked from commit 2214fd99e8)
2024-04-25 11:09:15 +02:00
Markus Gothe
8ee4951532 mcastmngr: Fix typo in Broadcom snooping.
(cherry picked from commit 65fbf9958d)
2024-04-09 12:18:54 +02:00
Rahul Thakur
3094ca245f mcastmgr: remove outdated comment 2024-03-27 11:35:47 +01:00
George Yang
715ac12974 mcastmngr: Set the "igmp" as the default protocol for mcast proxy/snooping config
For example, in the current LUCI iptv page, option "proto" is not provided, and IGMP is assumed.

(cherry picked from commit 8b39953242)
2024-03-15 10:30:31 +01:00
Mohd Husaam Mehdi
a73b9b1dec mcastmngr: do not hard code snooping_mode to 1 for proxy sections 2024-02-21 08:37:11 +00:00
Rohit Topno
25e01248c5 mcastmngr: fixed uci syntax error in init script
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.
2024-02-09 14:36:30 +05:30
Rahul Thakur
55e87e47f1 mcastmngr: fix uci-default script to not overwrite on upgrade
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.
2023-12-14 06:37:04 +00:00
Amit Kumar
c260fb4c61 mcastmngr: disable snooping when proxy instance is disabled
* 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.
2023-12-12 05:53:42 +00:00
Anatoly Mirin
b6477e8b84 mcastmngr: add snooping configuration support for linux targets
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.
2023-10-26 05:17:14 +00:00
Markus Gothe
e485a0514e mcastmngr: Fix error regarding setup_mcast_mode().
Implement a stub for setup_mcast_mode() on
non-Broadcom platforms.

Change-Id: Idd0c75f564f0de5fe698c1fc32088a32a029ac96
2023-09-20 11:44:30 +00:00
Rahul Thakur
10564d779c mcastmngr: remove dependency on ports uci file 2023-08-10 11:29:47 +00:00
Anatoly Mirin
7c3d1f919c mcastmngr: fixed mcproxy crash for multiupstream config
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'
2023-07-07 04:59:57 +00:00
Rahul Thakur
3a2674270b mcastmngr: implement snoop mode for linux targets 2023-06-22 04:38:35 +00:00
Anatoly Mirin
e9f64893ac mcastmngr: fix mcast stats script
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.
2023-06-12 23:48:08 +03:00
Anatoly Mirin
81bfe4cc1b mcastmngr: pass max groups parameter to mcproxy
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).
2023-06-02 05:27:09 +00:00
Ratish
65d1d7932c Revert "mcastmngr: pass max groups parameter to mcproxy"
This reverts commit 9ce866a484.
2023-06-01 10:12:04 +00:00
Ratish
c0495af6e1 mcastmngr: fixed mcproxy crash
Fixed mcproxy crash during bootup for non broadcom platforms
2023-05-31 13:30:36 +05:30
Anatoly Mirin
9ce866a484 mcastmngr: pass max groups parameter to mcproxy
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).
2023-05-29 22:50:49 +03:00
ratish.28
7a61ff27bf mcastmngr: fix mcast stats for non broadcom platforms
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.
2023-05-16 14:27:22 +00:00
Rahul Thakur
d930fdd86d mcastmngr: enable snooping on linux platforms
enabling snooping in bridges in case of linux platforms
2023-05-16 14:25:41 +00:00
Arun Muthusamy
d038e4c845 Fix: Qcm, iptv fast leave is broken 2023-05-04 10:24:17 +00:00
Rahul Thakur
ecf76ddb06 mcastmngr: fix uci config changes get overwritten 2023-05-02 10:42:18 +05:30
Anatoly Mirin
1abf717fc6 mcastmngr: add filtering rules for downstream
This is necessary to filter IGMP messages from downstream interfaces.
2023-04-26 01:20:10 +00:00
Erik Karlsson
9cf5186546 Remove service_stop use
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.
2023-04-18 05:59:55 +00:00
Anatoly Mirin
cb7256eba9 mcastmngr: fix ubus call in uci default script 2023-03-10 01:52:27 +00:00
Rahul Thakur
a92372c236 mcastmngr: update uci default script 2023-03-09 10:20:38 +00:00
Anatoly Mirin
95471502d7 mcastmngr: integrate mcproxy
linux/lib/mcast/linux.sh converts mcastmngr UCI params to the
mcproxy native conf file.
2023-02-16 08:34:26 +00:00
Sukru Senli
28fa1ed6f9 Mcast platform 2023-02-01 11:46:10 +00:00
Artee Roy
9675953bf6 Enables setting of bridge as a proxy interface.
Setting of dfault value for mcast interfaces.
2022-01-04 11:40:13 +00:00
Amit Kumar
4d244eb31e mcastmngr: corrected P1 break of mcast stats 2021-11-18 06:48:52 +00:00
Rahul
8f5d47b5d5 mcastmngr: openwrt 21.02 changes
make iptv work with openwrt 21.02 lift
2021-08-11 17:22:31 +05:30
Amit Kumar
aadbbda3e9 mcast: updated verion for change to remove lan_to_lan option 2021-07-14 09:33:27 +05:30
Amit Kumar
c9e6cf8428 mcast: removed lan_to_lan option 2021-07-14 03:23:39 +00:00
Amit Kumar
7265b88a70 mcast: correction for warning message in mcast restart.
removed the bcmmcastctl cli call for l2l option that is not supported.
2021-07-14 03:23:39 +00:00
Erik Karlsson
a6c3c54091 mcastmngr: do not overwrite configuration if snooping section exists 2021-04-15 07:57:06 +00:00
Rahul
a31bb99c30 mcastmngr: resolve bug #3015
Configuration of robustness value and fast leave in snooping take
effect.
2020-09-02 18:50:09 +05:30
Rahul
c0f7c0ecf1 mcastmngr: handle mcast config for ifup in snooping
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.
2020-07-17 12:25:17 +05:30
Rahul
3f6c55a86d mcastmngr: fix multicast forwarding on untagged interface.
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
2020-07-06 16:45:05 +05:30
Rahul
08c542cf6f mcastmngr: update stats param names, config l2l mcast
- The parameters used for stats are updated.
- Configuration support for lan to lan multicast via UCI added.
2020-06-14 20:15:07 +05:30
Rahul
098f3340b1 mcastmngr: add support for stats
ubus call added to fetch igmp stats, format is,
ubus call mcast stats

Sample output:

root@iopsys:~# ubus call mcast stats
{
	"snooping": [
		{
			"interface": "br-lan",
			"groups": [
				{
					"group_address": "225.10.10.20",
					"associated_devices": [
						{
							"host_address": "192.168.1.152",
							"source_interface": "eth1",
							"timeout": "258"
						}
					]
				},
				{
					"group_address": "225.10.10.2",
					"associated_devices": [
						{
							"host_address": "192.168.1.146",
							"source_interface": "eth0",
							"timeout": "259"
						}
					]
				}
			]
		}
	]
}
2020-06-14 13:26:12 +05:30
Rahul
36e9c3a3d7 mcastmngr: updates
- 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.
2020-06-09 13:31:33 +05:30
Rahul
33eeedcdd7 mcastmngr: fix upstream interface generation 2020-05-29 18:15:59 +05:30
Rahul
7cccc5d048 mcastmngr: add check for valid interface
Add check to validate if the configured interface is valid or not
before writing it into the mcpd.conf.
2020-05-29 12:56:01 +05:30
Rahul
c8a8cda534 mcastmngr: update proxy config
- generate proxy config by default
- resolve bug in processing multiple upstream or downstream interfaces
- add hotplug script for mcast
- add default values for query interval, response interval and last
  query response interval
2020-05-28 19:48:56 +05:30
Rahul
d0350ee279 mcastmngr: add support for snooping mode
Support for snooping mode configuration added.
2020-05-26 18:37:24 +05:30
Rahul
c37934cb69 mcastmngr: Fix section name issue
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.
2020-05-18 09:52:32 +05:30
Rahul
c7f037fdd7 bbf: Update mcastmngr to handle mld config
The mcast manager can now configure mld snooping and proxy
2020-04-23 14:41:31 +05:30