summaryrefslogtreecommitdiff
path: root/pimd/pim_igmp.c
AgeCommit message (Collapse)Author
2025-02-10pim6d: implement MLD source/group limitsRafael Zalamena
Let user configure a source/group limit for MLD protocol. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-10pimd: implement IGMP group/source count limitDavid Lamparter
For groups we can just look at the length of the list, for sources we need to count them on a per-interface level. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-12-06pimd,yang: Extend multicast boundary functionalityCorey Siltala
Add new interface command ip multicast boundary ACCESSLIST4_NAME. This allows filtering on both source and group using the extended access-list syntax vs. group-only as with the existing "ip multicast boundary oil" command, which uses prefix-lists. If both are configured, the prefix- list is evaluated first. The default behavior for both prefix-lists and access-lists remains "deny", so the prefix-list must have a terminating "permit" statement in order to also evaluate against the access-list. The following example denies groups in range 229.1.1.0/24 and groups in range 232.1.1.0/24 with source 10.0.20.2: ! ip prefix-list pim-oil-plist seq 10 deny 229.1.1.0/24 ip prefix-list pim-oil-plist seq 20 permit any ! access-list pim-acl seq 10 deny ip host 10.0.20.2 232.1.1.0 0.0.0.255 access-list pim-acl seq 20 permit ip any any ! interface r1-eth0 ip address 10.0.20.1/24 ip igmp ip pim ip multicast boundary oil pim-oil-plist ip multicast boundary pim-acl ! Signed-off-by: Corey Siltala <csiltala@atcorp.com>
2024-09-23pimd: add proxy join/prune functionalityBarry A. Trent
Use existing igmp static join infrastructure. Add an enum to distinguish static from proxy joins. Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-09-27pimd: IGMP Querier election is not correct in LAN scenarioMobashshera Rasool
When more than 2 routers are present in LAN and the querier goes down, the other routers will wait for other querier present timer to expire to elect a new querier. This issue will be seen when the router having next lower ip address expires the other querier present timer first and it starts sending the query message. Now on the other non-querier routers it will receive this query and reset its other querier present timer but the querier is still the old one and since it is lowest ip, it never gets updated to the newly elected querier. Reset the other querier timer only if query is received from the previously elected querier or a better new querier This will make sure that non-querier elects the new querier whose ip address is higher than the old querier when the old querier goes down via other querier querier timer expiry Issue: #12027 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
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-08-26pimd: Modifying member of pim_instance to accomodate IPv6 changesSai Gomathi N
Modifying igmp_group_count of struct pim_instance to gm_group_count which is to be used for both IGMP and MLD. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-30pimd: Modifying member of pim_instance to accomodate IPv6 changesSai Gomathi N
Modifying igmp_watermark_limit of struct pim_instance to gm_watermark_limit which is to be used for both IGMP and MLD. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-28pimd: Querier to non-querier transition to be ignoredMobashshera Rasool
Fixing IGMPv2 ANVL Conformance issue 3.10 As per RFC 2236 section 3, when the leave message is received at a querier, it starts sending Query messages for "last Member Query Interval*query count" During this time there should not be any querier to non-querier transition and the same router needs to send the remaning queries. Currently the code is handling this scenario only when leave is receive for a group and the query is received for the same group. But we need to handle it irrespective of group since the querier election is based on interface and not group. Signed-off-by: Mobashshera Rasool <mrasool@vmware.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-19*: Fix spelling of non-existantDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-08pimd: remove pim_interface->optionsDavid Lamparter
I should've removed this in #10960. It's a hazard in terms of forgetting to adjust PRs/other changes that might accidentally still reference the field. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-06Merge pull request #10965 from opensourcerouting/fix/pim_igmp_group_deletemobash-rasool
pimd: Replace ALL_LIST_ELEMENTS_RO to ALL_LIST_ELEMENTS group_list it…
2022-04-05pimd: Replace ALL_LIST_ELEMENTS_RO to ALL_LIST_ELEMENTS group_list iterationDonatas Abraitis
To reproduce: ``` ip pim ssm prefix-list pim-ssm-group ip prefix-list pim-ssm-group seq 10 permit 238.4.0.0/16 ge 32 le 32 ``` Assert: ``` pimd[645545]: pimd/pim_igmp.c:148: igmp_source_forward_reevaluate_all(): assertion ((srcnode)->data != NULL) failed PIM[645545]: Received signal 6 at 1649140750 (si_addr 0x6e0009d9a9, PC 0x7fe5e3f95ce1); aborting... PIM[645545]: /usr/local/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x5e) [0x7fe5e41f2d7e] PIM[645545]: /usr/local/lib/libfrr.so.0(zlog_signal+0xe6) [0x7fe5e41f2f56] PIM[645545]: /usr/local/lib/libfrr.so.0(+0xc9412) [0x7fe5e421d412] PIM[645545]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14140) [0x7fe5e4133140] PIM[645545]: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141) [0x7fe5e3f95ce1] PIM[645545]: /lib/x86_64-linux-gnu/libc.so.6(abort+0x123) [0x7fe5e3f7f537] PIM[645545]: /usr/local/lib/libfrr.so.0(_zlog_assert_failed+0xd7) [0x7fe5e4246c37] PIM[645545]: /usr/lib/frr/pimd(igmp_source_forward_reevaluate_all+0x230) [0x5638c65e3d90] PIM[645545]: /usr/lib/frr/pimd(pim_prefix_list_update+0x53) [0x5638c65cbbf3] PIM[645545]: /usr/local/lib/libfrr.so.0(prefix_list_entry_update_start+0x82) [0x7fe5e420a0a2] ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-04pimd: remove useless PIM_IF_* macrosDavid Lamparter
The only function these macros have is to make the code confusing. "PIM_IF_DO_PIM" sounds like it triggers some action, but it doesn't. Replace with "bool" fields in struct pim_interface. (Note: PIM_IF_*_IGMP_LISTEN_ALLROUTERS was always set, without any way to unset it. It is completely removed now and always enabled.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-02pimd, zebra: Fix spelling of fowardingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-28pimd: update the pim state when there is a group changeMobashshera Rasool
Re-evaluate the creation/deletion of groups when there is a change in group type. Issue: #10128 Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-28pimd: Do not create PIM state for invalid (S,G)Mobashshera Rasool
Currently FRR creates an (S,G) PIM state when an IGMPv3 (S,G) join with INCLUDE mode is received for the ASM group. Since it is an ASM group, we should not create (S,G) PIM state and should not be sending PIM (S,G) joins towards the source. This is a misconfiguration. So keep this group in IGMP table and do not create PIM state. Issue: #10128 Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-22pimd: correct prefix-list ssm range update for exclude modeMobashshera Rasool
Modifying the code as per RFC 4604 section 2.2.1 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. Issue is observed when a group in exclude mode was in ASM range as per the prefix-list and then prefix-list is modified to make it fall under SSM range. The (*,G) entry remains there. So when the group moves to ssm range and it is exclude mode, delete the group from the IGMP table. Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-15pimd: Add additional IGMP stats (peak number of groups)Donatas Abraitis
``` exit1-debian-11# sh ip igmp statistics interface eth2 IGMP statistics Interface : eth2 V1 query : 0 V2 query : 0 V3 query : 25 V2 leave : 0 V1 report : 0 V2 report : 0 V3 report : 34 mtrace response : 0 mtrace request : 0 unsupported : 0 joins failed : 0 joins sent : 13 general queries sent : 2 group queries sent : 24 peak groups : 9 total groups : 4 total source groups : 1 exit1-debian-11# sh ip igmp statistics interface eth2 json { "eth2":{ "name":"eth2", "queryV1":0, "queryV2":0, "queryV3":25, "leaveV2":0, "reportV1":0, "reportV2":0, "reportV3":34, "mtraceResponse":0, "mtraceRequest":0, "unsupported":0, "peakGroups":9, "totalGroups":4, "totalSourceGroups":1, "joinsFailed":0, "joinsSent":13, "generalQueriesSent":2, "groupQueriesSent":24 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
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-03-13Merge pull request #10399 from g-balaji1/pimv6-sockDonald Sharp
pim6d: PIMv6 socket related changes
2022-03-12pimd: refactor/split IGMP integrationDavid Lamparter
Try to untangle some spaghetti... This is an 1:1 change that should not result in any functional difference. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12pim6d: pim6d socket changesBalaji Gurudoss
socket changes to support IPv6 PIM Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com> [DL: cleaned up & refactored a whole bunch more.] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-24pimd: FRR drops IGMP packets for TOS value other than 0XC0Mobashshera Rasool
Currently the code is expecting the TOS value for received packet to be 0xC0 and hence it is discarding packets having TOS value other than 0xc0. We need to make sure that we are sending the packet with TOS 0xC0 and while receiving we can allow any TOS value. Let's follow Postel's law. Checked Cisco behavior as well. It also accepts all TOS values. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
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-02-07pimd: Querier to non-querier transistion to be ignored in a caseMobashshera Rasool
As per RFC 2236 section 3, when the leave message is received at a querier, it starts sending Query messages for "last Member Query Interval*query count" During this time there should not be any querier to non-querier transition and the same router needs to send the remaning queries. Fixes: #10422 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
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-11-25pimd: removing no caller functionsSai Gomathi
Removing the no caller function declarations and definitions in pimd directory. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-17*: clean up ifp-by-local-address function(s)David Lamparter
Most users of if_lookup_address_exact only cared about whether the address is any local address. Split that off into a separate function. For the users that actually need the ifp - which I'm about to add a few of - change it to prefer returning interfaces that are UP. (Function name changed due to slight change in behavior re. UP state, to avoid possible bugs from this change.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-04pimd: Do not explicitly set the thread pointer to NULLDonatas Abraitis
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
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-07-28Merge pull request #9194 from idryzhov/pim-bool-falseDonald Sharp
pimd: fix incorrect bool returns
2021-07-27pimd: Validate the fields before accessing itMobashshera Rasool
This commit is to correct the order in which the fields are accessed while verifying it. First the fields should be verified, and if it is valid then access it. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-27pimd: fix incorrect bool returnsIgor Ryzhov
-1 is true when casted to bool. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>