summaryrefslogtreecommitdiff
path: root/pimd/pim_igmpv3.c
AgeCommit message (Collapse)Author
2024-05-31pimd: fix crash when mixing ssm/any-source joinsJafar Al-Gharaibeh
There is no reason to call `igmp_anysource_forward_stop()` inside a call to `igmp_get_source_by_addr()`; not only it is not expected for a "get" function to perform such an action, but also the decision to start/stop forwarding is already handled correctly by pim outside `igmp_get_source_by_addr()`. That call was left there from the days pim was initially imported into the sources. The problem/crash was happening because `igmp_find_source_by_addr()` would fail to find the group/source combo when mixing `(*, G)` and `(S, G)`. When having an existing flow `(*, G)`, and a new `(S, G)` igmp is received, a new entry is correctly created. `igmp_anysource_forward_stop(group)` always stops and eventually frees `(*, G)`, even when the new igmp is `(S, G)`, leaving a bad state. I.e, the new entry for `(S, G)` causes `(*, G)` to be deleted. Tested the fix with multiple receivers on the same interface with several ssm and any source senders and receivers with various combination of start/stop orders and they all worked correctly. Fixes: #15630 Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com> (cherry picked from commit a951960a15e8b6b5ed248abb0ecc9eb4e9a3427f)
2022-09-13pimd, pim6d: Changing IGMP to GM in debug macros.Abhishek N R
Changed PIM_DEBUG_IGMP_TRACE to PIM_DEBUG_GM_TRACE and PIM_DEBUG_IGMP_TRACE_DETAIL to PIM_DEBUG_GM_TRACE_DETAIL. Hence, these macros can be used for both v6 and v4. Issue: #11895 Co-authored-by: Sai Gomathi N <nsaigomathi@vmware.com> Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-04pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_PACKETS to ↵Sai Gomathi N
PIM_DEBUG_GM_PACKETS Changing the macros to common so that it can be used for pimv6 debugs as well to be used for both IGMP and MLD debugs. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-04pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTSSai Gomathi N
Changing the macros to common so that it can be used for pimv6 debugs as well to be used for both IGMP and MLD debugs. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-05-25pimd: Disable handling v3 igmp packets on an interface config'ed for v2Donald Sharp
pimd is receiving v3 igmp packets on an interface that is setup as v2 and causing the igmp group as configured on that interface to get a bit wonky. Add a check to receiving v3 packets and to drop the packet if the igmp version configed on the interface is 2. Fixes: #11105 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-06pimd: un-dependency-hell `pim_instance.h`David Lamparter
This is causing build issues on BSD by including (transitively) `linux/mroute6.h` - try to address by disentangling the headers a bunch. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-21pimd: Set new to true in igmp_get_source_by_addr apiMobashshera Rasool
5421bf8 commit forgot to set the parameter "new" to true when a new source is created, have fixed it. igmp_get_source_by_addr api is currently setting the parameter "new" to false always. This is not right. The caller apis are using this field to decide and based on that take actions to create timers, etc. Its need to be set to true when a new source is created. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-19*: Fix spelling of non-existantDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02pimd, zebra: Fix spelling of fowardingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-15Merge pull request #10012 from AbhishekNR/upstreamDonald Sharp
pimd : Handling of Exclude mode IGMPv3 report messages for SSM aware group.
2022-03-14pimd: Add additional IGMP stats (generic/group specific queries sent)Donatas Abraitis
``` exit1-debian-11# sh ip igmp statistics IGMP statistics Interface : global V1 query : 0 V2 query : 0 V3 query : 6 V2 leave : 0 V1 report : 0 V2 report : 0 V3 report : 14 mtrace response : 0 mtrace request : 0 unsupported : 0 joins failed : 0 joins sent : 16 general queries sent : 6 group queries sent : 4 total groups : 5 total source groups : 1 exit1-debian-11# sh ip igmp statistics json { "global":{ "name":"global", "queryV1":0, "queryV2":0, "queryV3":6, "leaveV2":0, "reportV1":0, "reportV2":0, "reportV3":18, "mtraceResponse":0, "mtraceRequest":0, "unsupported":0, "totalGroups":5, "totalSourceGroups":1, "joinsFailed":0, "joinsSent":16, "generalQueriesSent":6, "groupQueriesSent":4 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-13pimd: Add IGMP join sent/failed statisticsDonatas Abraitis
``` exit1-debian-11# sh ip igmp statistics IGMP statistics Interface : global V1 query : 0 V2 query : 0 V3 query : 0 V2 leave : 0 V1 report : 0 V2 report : 0 V3 report : 16 mtrace response : 0 mtrace request : 0 unsupported : 0 joins failed : 0 joins sent : 11 total groups : 4 total source groups : 0 exit1-debian-11# sh ip igmp statistics json { "global":{ "name":"global", "queryV1":0, "queryV2":0, "queryV3":0, "leaveV3":0, "reportV1":0, "reportV2":0, "reportV3":16, "mtraceResponse":0, "mtraceRequest":0, "unsupported":0, "totalGroups":4, "totalSourceGroups":0, "joinsFailed":0, "joinsSent":11 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-20pimd : Handling of Exclude mode IGMPv3 report messages for SSM aware group.Abhishek N R
Problem Statement: ================== (rcv1)-----A----B---C v3 enabled with src 90.0.0.1 | (rcv2)-- v3 enable with src none rcv1 sends the packet in INCLUDE mode, rcv2 sends the IGMP report in exclude mode. As per the state machine the group structure was getting added and deleted. As group gets deleted the mroute for 90.0.0.1 and recreated back. This effects the end to end trafiic. Root Cause Analysis: ==================== As per state machine INCLUDE (A) IS_EX (B) EXCLUDE (A*B,B-A) (B-A)=0 Delete (A-B) Group Timer=GMI EXCLUDE (X,Y) TO_EX (A) EXCLUDE (A-Y,Y*A) (A-X-Y)=Group Timer Delete (X-A) Delete (Y-A) Send Q(G,A-Y) Group Timer=GMI The above equations were getiing calulated for IP address 90.0.0.1 and 0.0.0.0 This results in group creation deletion. Fix: ==== As per RFC 4604. drop the exclude mode, IGMP reports, if destnation group is SSM based. EXCLUDE mode does not apply to SSM addresses, and an SSM-aware router will ignore MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE requests in the SSM range. Signed-off-by: Abhishek N R <abnr@vmware.com> Signed-off-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
2022-01-17pimd: remove PIM_INADDR_IS[NOT]_ANY macrosDavid Lamparter
These really don't serve much of a purpose, especially with how inconsistently they're used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-11pimd: Modifying members of pim_interface to accommodate IPv6 changesSai Gomathi
Modifying the members of pim_interface which are to be used for both IPv4 and IPv6 to common names(for both MLD and IGMP). Issues: #10023 Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-15Merge pull request #10215 from FRRouting/revert-10164-name_changeStephen Worley
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"
2021-12-14Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"David Lamparter
2021-12-03pimd: Modifying struct igmp_sock to gm_sock for IPv6Sai Gomathi
Modifying name of struct igmp_sock to struct gm_sock, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-03pimd: Modifying name of struct igmp_group to struct gm_group for IPv6.Sai Gomathi
Modifying name of struct igmp_group to struct gm_group, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-03pimd: Modifying name of struct igmp_source to struct gm_source for IPv6.Sai Gomathi
Modifying name of struct igmp_source to struct gm_source, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-12-02pimd: Modifying members of pim_interface to accommodate IPv6 changesSai Gomathi
Modifying the members of pim_interface which are to be used for both IPv4 and IPv6 to common names(for both MLD and IGMP). Issue: #10023 Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-08-27pimd: fuse source_new() and add_source_by_addr()David Lamparter
This makes a lot more sense semantically (and matches the way groups are handled.) Also allows placing additional restrictions on source creation (e.g. limit on number of sources or ACLs.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-27pimd: reformat after dropping indent levelsDavid Lamparter
Intentionally separate here because the previous patch does a whole bunch of "move stuff up 1 level of indentation", and reviewing that is easier when you can use the ignore-whitespace option on diff. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-27pimd: IGMP memberships are not querier specificDavid Lamparter
IGMP group/source memberships are a property of the interface; the particular IP address that the querier used to collect the data is irrelevant. ... and IGMP packets get delivered only once to pimd anyway, since we receive them on the "global" per-VRF IGMP socket. (The one in igmp_sock is only used for sending queries.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-25pimd: fix coverity/dead-code issueJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2021-08-23pimd: IGMP groups are not getting timeoutSai Gomathi
Problem : ======= When all the groups from Ixia are stopped, groups still keep refreshing and not getting timeout RCA: ==== IGMP Report is coming in include mode without any source address, this problem will come. Fix : === If the requested filter mode is INCLUDE *and* the requested source list is empty, then the entry corresponding to the requested interface and multicast address is deleted if present. If no such entry is present, the request is ignored. When an interface receives the IGMP report without any source, then the group is deleted. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-07-01*: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlenDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-23pimd: zassert => assertDavid Lamparter
No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-11-17pimd: checksum must be validated before accepting igmp packetsMobashshera Rasool
Issue: When an IGMPv2 leave packet is received, it did not validate the checksum and hence the packet is accepted and group specific query is sent out in response to this. Due to this IGMP conformance test case 6.1 failed. https://github.com/FRRouting/frr/issues/6868 Fix: Validate the checksum for all IGMP packets Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-10-22pimd: replace inet_ntoaMark Stapp
Replace all use of inet_ntoa, using %pI4 or inet_ntoa instead Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-06*: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp
FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-12pimd: Cleanup igmp debugs a tiny bitDonald Sharp
When receiving igmp packets we are spitting out a lot of debugs. Attempt to clean this up to allow us to understand what is going on a bit better by just being able to look at the log file. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-14pimd: Add debugs for channel_oil creation and deletionDonald Sharp
Add some debugs so we can see channel oil creation and deletion events. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-29pimd: new cli to configure last-member-query-count & last-member-query-intervalSarita Patra
Introduce new cli commands ip igmp last-member-query-count <1-7> ip igmp last-member-query-interval <1-255> deciseconds. Display the config in show running config and show ip igmp interface Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-01-04pimd: Create a `struct pim_router` and move thread master into itDonald Sharp
Create a `struct pim_router` and move the thread master into it. Future commits will further move global varaibles into the pim_router structure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14pimd: Convert over to use LIB_ERR_XXX for zlog_errDonald Sharp
Convert, where appropriate, the zlog_err functions to zlog_ferr for the LIB_ERR_XXX enums Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11*: ALLOC calls cannot failDonald Sharp
There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-08pimd: Remove unnecessary alloc failuresDonald Sharp
Remove from pim unnecessary alloc failure testing as that alloc failure will cause an assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-04pimd: show ip igmp statistics commandMladen Sablic
Command showing IGMP Rx statistics, useful for analyzing IGMP activity on interfaces. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-08pimd: mtrace only IGMP socketsMladen Sablic
Feature of mtrace only IGMP sockets on pim sm and pim ssm interfaces. Modifed IGMP socket creation and show igmp interface command output. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2017-09-26pimd: add support for boundariesQuentin Young
Adds the ability to filter PIM Joins & IGMP reports on an interface. Enabling a multicast boundary on an interface for a particular group will prevent the interface from appearing in the group's OIL. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-24pimd: Cleanup pimg from pim_igmpv3.cDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Make XX_forward_start 'struct pim_instance *' awareDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-17pimd: Thread changes allow pim to crash a booDonald Sharp
When we add a thread pointer to thread_add_XXX functions when the specified function is called, thread.c is setting the thread pointer to NULL. This was causing pim to liberally pull it's zassert grenade pin's. Additionally clean up code to not set the NULL pointer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>