Commit graph

50 commits

Author SHA1 Message Date
Donald Sharp d97c535c1e *: Create termtable specific temp memory
When trying to track down a MTYPE_TMP memory leak
it's harder to search for it when you happen to
have some usage of ttable_dump.  Let's just give
it it's own memory type so that we can avoid
confusion in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-01 13:07:46 -04:00
Donald Sharp 75b3e82dfa *: Remove cost of including netinet/icmp.h everywhere
This file inclusion is only used in 3 places move
the includes to those spots.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:26:33 -05:00
Mark Stapp adca5c22c5 * : include event ptr in event_execute api
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>
2023-07-25 10:17:48 -04:00
Abhishek N R e9484001ee pim6d: Fixing core while running MLD conformance test.
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>
2023-07-18 03:11:21 -07:00
Mobashshera Rasool 7de521470f pim6d: MLD conformance querier-non-querier transition fix
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>
2023-06-26 07:45:30 -07:00
Mark Stapp efa2a5f8ad pimd: replace CPP_NOTICE lines with TODO comments
Replace the noisy CPP_NOTICE lines with TODO comments.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-05-04 10:26:33 -04:00
Donald Sharp f662a4194d
Merge pull request #13349 from opensourcerouting/pim6-mld-coverity-20230421
pimd: address some static analysis complaints
2023-04-22 11:02:51 -04:00
David Lamparter 54c037a187 pimd: annotate some pointers as non-null
... make static analysis happy.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 15:30:43 +02:00
David Lamparter ac4304d0fa pimd: harden MLD code loop boundaries
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>
2023-04-21 15:30:43 +02:00
Donald Sharp 35801e6234 pimd: Tell coverity what is really going on
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>
2023-04-21 07:38:11 -04:00
Donald Sharp 635d65e2c8
Merge pull request #13097 from AbhishekNR/mroute
pim6d: mroutes not created after disabling and enabling PIMv6.
2023-04-13 07:41:49 -04:00
Donald Sharp 24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 4f830a0799 *: Convert thread_timer_remain_XXX to event_timer_remain_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 8c1186d38e *: Convert thread_execute to event_execute
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e6685141aa *: Rename struct thread to struct event
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-03-24 08:32:17 -04:00
Donald Sharp cb37cb336a *: Rename thread.[ch] to event.[ch]
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>
2023-03-24 08:32:16 -04:00
Abhishek N R 00fed6ed3b pim6d: Fixing mroutes not created after disabling and enabling PIMv6.
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>
2023-03-23 21:55:06 -07:00
David Lamparter f4ac0a1c7c pimd: stop t_sg_expire in MLD NOINFO transition
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>
2023-03-17 13:38:31 +01:00
Sarita Patra cbb1e51311 pim6d: Fix missing parameters in "show ipv6 mld interface" command
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>
2023-02-24 23:58:30 -08:00
Sarita Patra 3ab119a4bb pim6d: Display primary address in "show ipv6 mld interface json" cmd
Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-02-24 07:21:15 -08:00
Sarita Patra fe4db62c3d pim6d: Don't display MLD disabled or down interfaces in "show ipv6 mld 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>
2023-02-24 07:21:15 -08:00
Donald Sharp 8383d53e43
Merge pull request #12780 from opensourcerouting/spdx-license-id
*: convert to SPDX License identifiers
2023-02-17 09:43:05 -05:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Sarita Patra 58971e1574 pim6d: Modify "show ipv6 mld join json" o/p
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>
2023-02-09 00:14:24 -08:00
David Lamparter 89cb86aeb0 build, vtysh: extract vtysh commands from .xref
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>
2022-10-26 17:12:34 +01:00
David Lamparter a0dfca37b5 *: fix some malformed CLI docstrings
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06 15:39:56 +02:00
Abhishek N R 6b94500dba pim6d: Adding last member query count field in "show ipv6 mld interface [ifname] json" command.
Fixes: #12004

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-26 00:10:58 -07:00
Donatas Abraitis 96e8d5fb04
Merge pull request #11918 from patrasar/show_ipv6_mld_interface_fix
pim6d: "show ipv6 mld interface" command
2022-09-21 10:19:33 +03:00
Donald Sharp 81d6a47bf0
Merge pull request #11917 from patrasar/pimv6_clear_mroute_fix
pim6d: fix clear ipv6 mroute crash
2022-09-19 08:34:37 -04:00
Mobashshera Rasool 5784a87811 pim6d: Fixing coverity issues for pim6_mld.c
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>
2022-09-16 03:12:13 -07:00
Sarita Patra e309780f12 pim6d: fix clear ipv6 mroute crash
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>
2022-09-15 20:32:49 -07:00
Abhishek N R a96d64b0d6 pimd, pim6d: Changing IGMP to GM in debug macros.
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-13 23:29:33 -07:00
Sarita Patra ad56b07c09 pim6d: fix "show ipv6 mld interface" command
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>
2022-09-13 20:36:07 -07:00
Abhishek N R cb406d5cd7 pim6d: Adding additional details for "show ipv6 mld interface [ifname] json" 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>
2022-09-05 22:51:03 -07:00
Sai Gomathi N 55eb347de9 pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_PACKETS to 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-04 22:46:09 -07:00
Sai Gomathi N 95b13dc512 pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTS
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-04 22:46:09 -07:00
Abhishek N R 707a9e9a90 pim6d: Completing "ipv6 mld last-member-query-interval" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-28 23:33:07 -07:00
Abhishek N R 51b4991feb pim6d: Completing "ipv6 mld last-member-query-count" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-28 23:33:07 -07:00
Abhishek N R 914710d79e pim6d: Completing "ipv6 mld query-max-response-time" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-28 23:33:07 -07:00
Sai Gomathi N cdc1b7709f pim6d: Implementing "show mld groups" CLI
To Display MLD Group information

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-26 01:14:08 -07:00
Donatas Abraitis b32cf39d45
Merge pull request #11485 from AbhishekNR/ipv6_mld_todo
pim6d: Completing "ipv6 mld" config command.
2022-08-18 09:47:03 +03:00
Sarita Patra 4459f499c4 pim6d: fix clear ipv6 mroute
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-08-03 07:47:36 -07:00
Abhishek N R 5c1b3cd2d9 pim6d: Completing "ipv6 mld" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-07-07 04:36:33 -07:00
Donald Sharp f4e8f5d496 pimd: Checks imply that pim is not properly configured
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>
2022-06-23 13:43:25 -04:00
David Lamparter df655593a2 pim6d: change MLD socket to be per VRF
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter d2951219a1 pim6d: add some show commands for MLD
Just some basic show commands to get going.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter aa2f934929 pim6d: count stats for MLD
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter 5e5034b0a2 pim6d: add fresh MLD implementation
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>
2022-05-06 16:01:59 +02:00