summaryrefslogtreecommitdiffstats
path: root/pimd/pim6_mld.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * : include event ptr in event_execute apiMark Stapp2023-07-251-3/+3
| | | | | | | | | Include an event ptr-to-ptr in the event_execute() api call, like the various schedule api calls. This allows the execute() api to cancel an existing scheduled task if that task is being executed inline. Signed-off-by: Mark Stapp <mjs@labn.net>
* pim6d: Fixing core while running MLD conformance test.Abhishek N R2023-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While running MLD conformance test 9.2 core is getting generated. Test setps: 1. ANVL: Listen (for upto <GeneralQueryRecvWaitTime> seconds) on <AIface-0>. 2. DUT: Send MLD General Query Message. 3. ANVL: Send MLD Report Message to <DIface-0> containing: • IPv6 Source Address field set to link-local IPv6 Address of HOST-1 • IPv6 Destination Address field set to <McastAddrGroup> • MLD Multicast Address field set to <McastAddrGroup>. 4. ANVL: Wait for <ProcessTime> seconds for DUT to process and add <Mcas- tAddrGroup> to its Multicast Address list. 5. ANVL: Send MLD General Query Message to <DIface-0> containing: • IPv6 Source Address field set to link-local IPv6 Address of RTR-1 which is numerically less than the link-local IPv6 unicast address of <DIface-0> • IPv6 Destination Address field set to link-scope all-nodes multicast address. 6. ANVL: Send MLD Multicast-Address-Specific Query Message to <DIface-0> containing: • IPv6 Source Address field set to link-local IPv6 Address of RTR-1 • IPv6 Destination Address field set to <McastAddrGroup> • MLD Multicast Address field set to <McastAddrGroup> • MLD Maximum Response Delay field value set to 0. 7. ANVL: Verify that the Maximum Response Delay timer for <McastAd- drGroup> is set to zero. While running above test, when group specific query is received we start gm_t_sg_expire timer. Once this timer expires, we clear the corresponding entry. During this sg->state was still set to JOIN. This happened because receiver went down without sending leave. Added a condition to update the sg->state before starting the timer. If receiver goes down without sending leave we will update sg->state to GM_SG_JOIN_EXPIRING or GM_SG_NOPRUNE_EXPIRING based on previous state. If we receive a join then sg->state will be refreshed and will be updated to JOIN state. Fixes: #13387 Signed-off-by: Abhishek N R <abnr@vmware.com>
* pim6d: MLD conformance querier-non-querier transition fixMobashshera Rasool2023-06-261-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ANVL Conformance test case 7.31 failed because DUT after receiving MLD Done msg and a query message with lower adddress, DUT did not keep on sending the group specific queries since it moved to non-querier state. As per RFC 2710 s4 p7, DUT is supposed to keep sending the group specific queries until either it receives the membership report or there is no response even after last member query is sent. Fix: Whenever group specific queries are sent out we are checking if the self node is querier, if not it does not sends this query out. This check is preventing the continuation of the last queries which must be sent out although the self node is not the querier. Hence removing the check from the api gm_trigger_specific_query and adding in the caller to make sure this event is only added for queriers. This will make sure the last member queries are sent out even during the transition phase. Also earlier this event was getting added for non-querier as well which is redundant since queries were not required to be sent out by non-queriers. Issue: #13539 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* pimd: replace CPP_NOTICE lines with TODO commentsMark Stapp2023-05-041-5/+10
| | | | | | Replace the noisy CPP_NOTICE lines with TODO comments. Signed-off-by: Mark Stapp <mjs@labn.net>
* Merge pull request #13349 from opensourcerouting/pim6-mld-coverity-20230421Donald Sharp2023-04-221-8/+28
|\ | | | | pimd: address some static analysis complaints
| * pimd: annotate some pointers as non-nullDavid Lamparter2023-04-211-0/+3
| | | | | | | | | | | | ... make static analysis happy. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * pimd: harden MLD code loop boundariesDavid Lamparter2023-04-211-8/+25
| | | | | | | | | | | | | | | | | | Coverity complains about these being tainted/untrusted loop boundaries. The way the code works, it's counting up groups/sources, but keeps checking against remaining data length in the packet - which is perfectly fine IMHO. Except Coverity doesn't understand it :( Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pimd: Tell coverity what is really going onDonald Sharp2023-04-211-0/+13
|/ | | | | | | Fix a code path that coverity has decided a variable is NULL when it never can be. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #13097 from AbhishekNR/mrouteDonald Sharp2023-04-131-4/+2
|\ | | | | pim6d: mroutes not created after disabling and enabling PIMv6.
| * pim6d: Fixing mroutes not created after disabling and enabling PIMv6.Abhishek N R2023-03-241-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After doing "no ipv6 pim" and "ipv6 pim" on receiver interface in LHR, mroutes were not created. When we enable pim after disabling it, we refresh the membership on pim interface. First we clear the membership on the interface, then we add it back. For PIMv6 we were only clearing it, membership was not added back. So mroutes were not created. Now added code to fetch all the local membership information into PIM. Fixes: #12005, #12820 Signed-off-by: Abhishek N R <abnr@vmware.com>
* | *: Convert event.h to frrevent.hDonald Sharp2023-03-241-1/+1
| | | | | | | | | | | | | | We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp2023-03-241-28/+28
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp2023-03-241-2/+2
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_execute to event_executeDonald Sharp2023-03-241-3/+3
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-23/+21
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Rename `struct thread` to `struct event`Donald Sharp2023-03-241-9/+9
| | | | | | | | | | | | | | | | | | 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>
* | *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-241-1/+1
|/ | | | | | | | | | | This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: stop t_sg_expire in MLD NOINFO transitionDavid Lamparter2023-03-171-0/+7
| | | | | | | | | | | | When hitting gm_sg_update from the S,G expiry timer, t_sg_expire will already be cancelled. But when arriving there from e.g. the MLD packet getting cleared out, it'll still be running. Clear out the timer if we arrive with `has_expired == true`. Fixes: #12441 Reported-by: Vijay Kumar Gupta <vijayg@vmware.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: Fix missing parameters in "show ipv6 mld interface" commandSarita Patra2023-02-251-13/+30
| | | | | | | | | | | | | | | | | | Before fix: ========== frr# show ipv6 mld interface Interface State V Querier Timer Uptime ens224 up 1 fe80::250:56ff:feb7:a7e3 query 00:00:24.219 00:00:07.031 After fix: ========= frr(config-if)# do show ipv6 mld interface Interface State Address V Querier QuerierIp Query Timer Uptime ens224 up fe80::250:56ff:feb7:a7e3 1 local fe80::250:56ff:feb7:a7e3 00:01:22.263 00:08:00.237 Issue: #11241 Signed-off-by: Sarita Patra <saritap@vmware.com>
* pim6d: Display primary address in "show ipv6 mld interface json" cmdSarita Patra2023-02-241-0/+2
| | | | Signed-off-by: Sarita Patra <saritap@vmware.com>
* pim6d: Don't display MLD disabled or down interfaces in "show ipv6 mld ↵Sarita Patra2023-02-241-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | interface" cmd We should not display down interfaces or MLD disabled interfaces in "show ipv6 mld interface" command. Before fix: ========== frr# show ipv6 mld interface Interface State V Querier Timer Uptime ens192 up 2 fe80::250:56ff:feb7:d04 query 00:00:25.432 00:00:07.038 ens224 up 1 fe80::250:56ff:feb7:a7e3 query 00:00:24.219 00:00:07.031 pim6reg down After fix: ========= frr# show ipv6 mld interface Interface State V Querier Timer Uptime ens192 up 2 fe80::250:56ff:feb7:d04 query 00:00:25.432 00:00:07.038 ens224 up 1 fe80::250:56ff:feb7:a7e3 query 00:00:24.219 00:00:07.031 Issue: #11241 Signed-off-by: Sarita Patra <saritap@vmware.com>
* Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-171-14/+1
|\ | | | | *: convert to SPDX License identifiers
| * *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pim6d: Modify "show ipv6 mld join json" o/pSarita Patra2023-02-091-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently "show ipv6 mld join json" o/p is frr# show ipv6 mld joins json { "default":{ "ens192":{ "ff02:2":{ "::":{ "state":"JOIN", "created":"00:01:50.595", "lastSeen":"00:00:38.403", } } } } } Here, I modified the o/p as below for better understanding. frr# show ipv6 mld joins json { "default":{ "vrf":"default", "ens192":{ "ff02::2":{ "*":{ "state":"JOIN", "created":"00:00:42.766", "lastSeen":"00:00:05.266" } } } } } Issue: #12755 Signed-off-by: Sarita Patra <saritap@vmware.com>
* build, vtysh: extract vtysh commands from .xrefDavid Lamparter2022-10-261-2/+0
| | | | | | | | | | | | | | | | | | | Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix some malformed CLI docstringsDavid Lamparter2022-10-061-2/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: Adding last member query count field in "show ipv6 mld interface ↵Abhishek N R2022-09-261-0/+2
| | | | | | | | [ifname] json" command. Fixes: #12004 Signed-off-by: Abhishek N R <abnr@vmware.com>
* Merge pull request #11918 from patrasar/show_ipv6_mld_interface_fixDonatas Abraitis2022-09-211-2/+2
|\ | | | | pim6d: "show ipv6 mld interface" command
| * pim6d: fix "show ipv6 mld interface" commandSarita Patra2022-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: ===== frr# show ipv6 mld interface All VRFs Fix: === frr# show ipv6 mld interface MLD interface information Signed-off-by: Sarita Patra <saritap@vmware.com>
* | Merge pull request #11917 from patrasar/pimv6_clear_mroute_fixDonald Sharp2022-09-191-48/+37
|\ \ | | | | | | pim6d: fix clear ipv6 mroute crash
| * | pim6d: fix clear ipv6 mroute crashSarita Patra2022-09-161-48/+37
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Root Cause: "clear ipv6 mroute" was not deleting the subscribers of gm_if structure. Fix: The command "clear ipv6 mroute" deletes grp_pends, gsq_pends, sgs, subscribers, expires of gm_if data structure. Deleted the common code in gm_ifp_teardown() and called gm_group_delete(). Issue: #11724 Signed-off-by: Sarita Patra <saritap@vmware.com>
* | pim6d: Fixing coverity issues for pim6_mld.cMobashshera Rasool2022-09-161-1/+1
| | | | | | | | | | | | | | CID 1519843 (#2 of 2): Uninitialized scalar variable (UNINIT) 43. uninit_use_in_call: Using uninitialized value pkt_src->sin6_addr when calling gm_rx_process Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* | pimd, pim6d: Changing IGMP to GM in debug macros.Abhishek N R2022-09-141-12/+12
| | | | | | | | | | | | | | | | | | | | | | 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>
* | pim6d: Adding additional details for "show ipv6 mld interface [ifname] json" ↵Abhishek N R2022-09-061-0/+9
|/ | | | | | | | | | | command. Added Robustness value, Query interval, Query response timer and Last member query interval field in json output. Issue: #11891 Signed-off-by: Abhishek N R <abnr@vmware.com>
* pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_PACKETS to ↵Sai Gomathi N2022-09-051-5/+5
| | | | | | | | | 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>
* pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTSSai Gomathi N2022-09-051-6/+6
| | | | | | | 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>
* pim6d: Completing "ipv6 mld last-member-query-interval" commandAbhishek N R2022-08-291-2/+10
| | | | Signed-off-by: Abhishek N R <abnr@vmware.com>
* pim6d: Completing "ipv6 mld last-member-query-count" command.Abhishek N R2022-08-291-1/+5
| | | | Signed-off-by: Abhishek N R <abnr@vmware.com>
* pim6d: Completing "ipv6 mld query-max-response-time" command.Abhishek N R2022-08-291-3/+8
| | | | Signed-off-by: Abhishek N R <abnr@vmware.com>
* pim6d: Implementing "show mld groups" CLISai Gomathi N2022-08-261-2/+123
| | | | | | To Display MLD Group information Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
* Merge pull request #11485 from AbhishekNR/ipv6_mld_todoDonatas Abraitis2022-08-181-1/+9
|\ | | | | pim6d: Completing "ipv6 mld" config command.
| * pim6d: Completing "ipv6 mld" command.Abhishek N R2022-07-071-1/+9
| | | | | | | | Signed-off-by: Abhishek N R <abnr@vmware.com>
* | pim6d: fix clear ipv6 mrouteSarita Patra2022-08-031-0/+16
|/ | | | Signed-off-by: Sarita Patra <saritap@vmware.com>
* pimd: Checks imply that pim is not properly configuredDonald Sharp2022-06-231-1/+1
| | | | | | | | The call to gm_update_ll checks for null pointers and implies to SA that things could not be configured correctly This is not true with the code flow. Remove the confusing code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pim6d: change MLD socket to be per VRFDavid Lamparter2022-05-061-99/+140
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: add some show commands for MLDDavid Lamparter2022-05-061-0/+549
| | | | | | Just some basic show commands to get going. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: count stats for MLDDavid Lamparter2022-05-061-7/+63
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: add fresh MLD implementationDavid Lamparter2022-05-061-0/+2365
Fresh ground-up MLD implementation with subscriber-tracking for MLDv2. Intended to be adapted for IPv4 and replace the IGMP implementation at a later point. Tested in ANVL, currently at 94/116. Some issues/TODOs are left in the code as CPP_NOTICE markers, but the code is very much good enough to proceed since otherwise we're blocked on overall PIM v6 progress. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>