Commit graph

2960 commits

Author SHA1 Message Date
Mark Stapp 098d692b6f *: expose and clean up 'noreturn' functions
Enable the -Wmissing-noreturn warning, and resolve warnings
for gcc and clang. Add a FRR_NORETURN macro and use that for
the new changes.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-24 13:41:23 -04:00
Jafar Al-Gharaibeh 1b0bac0e68
Merge pull request #18652 from donaldsharp/pim_ssmpingd
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
Fix Pim ssmpingd
2025-04-24 10:52:48 -05:00
Jafar Al-Gharaibeh c3c46adf16
Merge pull request #18672 from usrivastava-nvidia/master
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
pimd: Fix for crash during networking restart
2025-04-23 23:17:45 -05:00
Donald Sharp 23fcf31358 pimd: Allow ssmpingd command to work for pim
Commit: 1c56018f66
broke the ssmpingd implementation in pim.  This
is because it just completely botched the bind
to the correct port and address.

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2025-04-23 13:56:07 -04:00
Utkarsh Srivastava b88cce2330 pimd: Fix for crash during networking restart
During vrf delete, the vxlan_info.work_list
linked list was deleted which is a global list
containing the SGs for all the VRFs.

If two vrfs are configured, vrf a and vrf b and
both has SGs assocaited with them which are
inserted in the vxlan_info.work_list. Now if
vrf a is deleted, it deletes the work_list also.
Due to this when any SG add or del comes for vrf b
it tries to access the work_list and crashes.

Fix
Delete the vxlan_info.work_list only when all the
VRFs are terminated and unset the vxlan_info.flags
so if new add cmd comes it re-allocates the work_list.

Signed-off-by: usrivastava-nvidia <usrivastava@nvidia.com>
2025-04-23 14:03:02 +00:00
Donald Sharp 5d4c7d2ece
Merge pull request #18675 from mjstapp/fix_clang_18_warnings
lib,pimd,bgpd,bfdd: Fix clang 18 warnings
2025-04-17 18:38:21 -04:00
Donald Sharp 2892c20097
Merge pull request #18538 from nabahr/autorp-enabling
pimd: Only create and bind the autorp socket when really needed
2025-04-17 10:14:13 -04:00
Mark Stapp d378275106 pimd: clean up clang warnings
Clean up clang warnings in pimd; mostly address-of-packed
issues (removed some ugly casts too).

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-16 13:50:21 -04:00
Christian Hopps f5a8b8aedf
Merge pull request #18610 from lsang6WIND/yang-isisd
fix yang commands that don't have yang attr
2025-04-15 10:25:51 -05:00
Jafar Al-Gharaibeh c2ee9a360e
Merge pull request #18578 from ak503/pim6_use_source
pim6d: fix missing 'use-source' interface command
2025-04-14 14:07:26 -05:00
Dmitrii Turlupov 467e1ed597 pim6d: fix missing 'use-source' interface command
Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
2025-04-12 09:54:19 +03:00
David Lamparter 8418e57791
Merge pull request #17915 from mjstapp/compile_wshadow 2025-04-09 09:59:06 +02:00
Mark Stapp aece400f10 pimd: clean up variable-shadow warnings
Clean up -Wshadow warnings in pimd

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
Jafar Al-Gharaibeh 3510904f1d
Merge pull request #18526 from donaldsharp/pim_leakage
pimd: Fix memory leak on shutdown
2025-04-08 10:19:33 -05:00
Loïc Sang e65d12f4e5 pimd: add YANG attr to YANG cmd
Those commands are using northbound api, add YANG attr to them. This
will allow them to use with pending commit, else the validation will
failed as they are detected as non YANG cmd.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2025-04-08 17:05:52 +02:00
Nathan Bahr 153d9ea3b9 pimd: Initialize gm proxy to false
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-04-02 21:07:41 +00:00
Donald Sharp 521b58945c pimd: Fix memory leak on shutdown
The gm_join_list has a setup where it attempts to only
create the list upon need and deletes it when the list
is empty.  On interface shutdown it was calling the
function to empty the list but it was not empty so
the list was being left at the end.  Just add a bit
of code to really clean up the list in the shutdown
case.

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    0 0x7f84850b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f8484c391c4 in qcalloc lib/memory.c:106
    2 0x7f8484c1ad36 in list_new lib/linklist.c:49
    3 0x55d982827252 in pim_if_gm_join_add pimd/pim_iface.c:1354
    4 0x55d982852b59 in lib_interface_gmp_address_family_join_group_create pimd/pim_nb_config.c:4499
    5 0x7f8484c6a5d3 in nb_callback_create lib/northbound.c:1512
    6 0x7f8484c6a5d3 in nb_callback_configuration lib/northbound.c:1910
    7 0x7f8484c6bb51 in nb_transaction_process lib/northbound.c:2042
    8 0x7f8484c6c164 in nb_candidate_commit_apply lib/northbound.c:1381
    9 0x7f8484c6c39f in nb_candidate_commit lib/northbound.c:1414
    10 0x7f8484c6cf1c in nb_cli_classic_commit lib/northbound_cli.c:57
    11 0x7f8484c72f67 in nb_cli_apply_changes_internal lib/northbound_cli.c:195
    12 0x7f8484c73a2e in nb_cli_apply_changes lib/northbound_cli.c:251
    13 0x55d9828bd30f in interface_ip_igmp_join_magic pimd/pim_cmd.c:5436
    14 0x55d9828bd30f in interface_ip_igmp_join pimd/pim_cmd_clippy.c:6366
    15 0x7f8484bb5cbd in cmd_execute_command_real lib/command.c:1003
    16 0x7f8484bb5fdc in cmd_execute_command lib/command.c:1062
    17 0x7f8484bb6508 in cmd_execute lib/command.c:1228
    18 0x7f8484cfb6ec in vty_command lib/vty.c:626
    19 0x7f8484cfbc3f in vty_execute lib/vty.c:1389
    20 0x7f8484cff9f0 in vtysh_read lib/vty.c:2408
    21 0x7f8484cec846 in event_call lib/event.c:1984
    22 0x7f8484c1a10a in frr_run lib/libfrr.c:1246
    23 0x55d9828fc765 in main pimd/pim_main.c:166
    24 0x7f848470c249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-29 11:54:36 -04:00
Nathan Bahr 133bb5f614 pimd: Only create and bind the autorp socket when really needed
Previously, the autorp socket would get created and bind if needed
by autorp configuration.
This update limits it further to also require pim enabled interfaces
in the vrf before the socket is created and bind.
So now the socket will automatically close if there are no pim
enabled interfaces left, or if autorp is turned off. It will
automatically turn on if autorp is turned on and there are pim
enabled interfaces in the vrf.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-03-28 16:50:09 +00:00
usrivastava-nvidia eb4c1610cb pimd:Skip RPF check for SA message received from the MSDP mesh group peers
Signed-off-by: Utkarsh Srivastava <usrivastava@nvidia.com>
2025-03-20 16:18:02 +00:00
usrivastava-nvidia 5934b6f402 pimd:Setting the flag PIM_MSDP_PEERF_IN_GROUP for MSDP mesh group peers
Signed-off-by: Utkarsh Srivastava <usrivastava@nvidia.com>
2025-03-20 16:17:39 +00:00
Martin Buck 374c8dc4db pimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo)
When receiving MLD messages, prefer pktinfo over msghdr.msg_name for
determining the source interface. The latter is just the VRF master
interface in case of VRF and we need the true interface the packet was
received on instead.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2025-03-05 16:27:23 +01:00
Rafael Zalamena cacdff75a6 pimd: fix null memory access on IGMP source limit
When the IGMP group source limit is reached the function
`igmp_get_source_by_addr` won't return a `struct gm_source` so we must
test for that condition before attempting to access its fields.

Fixes coverity scan issue 1637406.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-28 11:34:36 -03:00
Jafar Al-Gharaibeh f35de3f8cb
Merge pull request #18216 from gromit1811/bugfix_pim_vrf_register
pimd: Fix PIM VRF support (send register/register stop in VRF)
2025-02-24 12:56:08 -06:00
Donald Sharp 777aae08cf
Merge pull request #18226 from nabahr/pim-vrf-bind
pim: Fix vrf binding of autorp and mroute socket
2025-02-24 13:53:39 -05:00
Nathan Bahr d840560b74 pim: Fix autorp group joins
Group joining got broken when moving the autorp socket to open/close
as needed. This fixes it so autorp group joining is properly handled
as part of opening the socket.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 21:38:32 +00:00
Nathan Bahr 7e181a771c pim: Fix vrf binding of autorp and mroute socket
Bind the autorp socket to the vrf device.
Also fixed mroute socket to use vrf_bind instead of directly
setting the socket option.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 19:32:40 +00:00
Martin Buck 5a01011e0d pimd: Fix PIM VRF support (send register/register stop in VRF)
In 9461953914 and
8ebcc02328, transmission of PIM register and
register stop messages was changed to use a separate socket. However, that
socket is not bound to a possible VRF, so the messages were sent in the
default VRF instead. Call vrf_bind() once after socket creation and when the
VRF is ready to ensure transmission in the correct VRF. vrf_bind() handles
the non-VRF case (i.e. VRF_DEFAULT) automatically, so it may be called
unconditionally.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2025-02-21 09:00:55 +01:00
Mark Stapp bf8e4a3b83
Merge pull request #17666 from routingrocks/pim_fhr_rp
pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED sta…
2025-02-20 13:41:10 -05:00
Jafar Al-Gharaibeh fc6b0413fa
Merge pull request #14227 from routingrocks/pim_data_fix
pimd: Fix for data packet loss when FHR is LHR and RP
2025-02-20 10:56:05 -06:00
David Lamparter b84493132c pimd: allow restricting neighbors per interface
Just filter incoming packets against a specified prefix-list.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-19 09:49:06 -03:00
Rafael Zalamena 80a12477e0 pimd,topotests: frrbot styling suggestions
Incorporate frrbot suggestion to avoid the CI warning.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13 13:07:34 -03:00
David Lamparter df9517c95a pimd: add IGMPv2/MLDv1 immediate-leave
(Somewhat) useful when dealing with an interface that has only one host
attached.  Only works for IGMPv2 and MLDv1, other protocol versions have
no leave message.

Co-authored-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13 12:45:47 -03:00
Rajesh Varatharaj 8280257cc9 pimd: Fix for data packet loss when FHR is LHR and RP
Topology:
A single router is acting as the First Hop Router (FHR), Last Hop Router (LHR), and RP.

RC and Issue:
When an upstream S,G is in join state, it sends a register message to the RP.
If the RP has the receiver, it sends a register stop message and switches to the shortest path.
When the register stop message is processed, it removes pimreg, moves to prune,
and starts the reg stop timer.

When the reg stop timer expires, PIM changes S,G state to Join Pending and sends out a NULL
register message to RP. RP receives it and fails to send Reg stop because SPT is not set at that point.

The problem is when the register stop timer pops and state is in Join Pending.
According to https://www.rfc-editor.org/rfc/rfc4601#section-4.4.1,
we need to put back the pimreg reg tunnel into the S,G mroute.
This causes data to be sent to the control plane and subsequently interrupts the line rate.

Fix:
If the router is FHR and RP to the group,
ignore SPT status and send out a register stop message back to the DR (in this context, the same router).

Ticket: #3506780

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2025-02-11 09:52:15 -08:00
Rafael Zalamena 99861a084a pim6d: implement clear IPv6 MLD interfaces
Allow user to reset MLD state on all interfaces in a VRF.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-10 15:40:07 -03:00
Rafael Zalamena a98f2b86c4 pim6d: implement MLD source/group limits
Let user configure a source/group limit for MLD protocol.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-10 15:40:07 -03:00
David Lamparter f07d379b74 pimd: implement IGMP group/source count limit
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>
2025-02-10 15:40:07 -03:00
Jafar Al-Gharaibeh 452732024e
Merge pull request #18048 from opensourcerouting/msdpt3f
pimd: fix DR election race on startup
2025-02-06 21:40:45 -06:00
Rafael Zalamena fd66ede08b
Merge pull request #14105 from routingrocks/pim_ageout_fix
pimd: Fix for FHR mroute taking longer to age out
2025-02-06 21:25:45 -03:00
Rafael Zalamena 8644524606 pimd: fix DR election race on startup
In case interface address is learnt during configuration, make sure to
run DR election when configuring PIM/PIM passive on interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-06 19:30:51 -03:00
Rajesh Varatharaj 51f26d17da pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED state (conformance issue)
Issue:
If there are any changes to the prefix list, we perform a re-lookup to map the correct RP for the group.
Even if the S,G entry is PIM_UPSTREAM_NOTJOINED and in FHR, In the case of IGMPv3, an S,G entry can be
created with no joins. this is not necessary.
 https://www.rfc-editor.org/rfc/rfc4601#section-4.5.7 says no op in case of NOTJOINED

Solution:
To solve this issue, Stop RP mapping when the state is NOTJOINED

Ticket: #3496931

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2025-02-06 10:59:34 -06:00
Rajesh Varatharaj afed39ea2b pimd: Fix for FHR mroute taking longer to age out
Issue:
When there is no traffic for a group, the LHR and RP take the default KAT+Join timer expiry of
a maximum of 480 seconds to clear the S,G . However, in the FHR, we update the state from JOINED
to NOT Joined, downstream state from PPto NOINFO.  This restarts the ET timer, causing S,G on FHR to
take more than 10 minutes to age out.

In other words,
Consider a case where (S,G) is in Join state. When the traffic stops and the KAT (210) expires,
 the Join expiry timer restarts. At this time, if we receive a prune, the expectation is to set
 PPT to 0 (RFC 4601 sec 4.5.2).
 When the PPT expires, we move to the noinfo state and restart the expiry timer one more time. We remove the
 (S,G) entry only after ~10 minutes when there is no active traffic.

Summary:
KAT Join ET 210 + PP ET 210 + NOINFO ET 210.

Solution:
Delete the ifchannel when in noinfo state, and KAT is not running.

Ticket: #13703

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2025-02-06 10:19:46 -06:00
Rafael Zalamena d1440dadff pimd: fix memory leak and assign allocation type
Use a memory allocation specific type for filter names (to help detect memory
leaks) and fix a memory leak when releasing peer memory.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-06 10:17:19 -03:00
Nathan Bahr 5d102a0a70 pimd: Close AutoRP socket when not needed
Don't leave the socket open if we are not enabled for discovery
or announcements.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-27 17:04:14 +00:00
Donald Sharp 5867c32161
Merge pull request #17776 from nabahr/group-rpf-mode
PIMD: RPF lookup mode per-group, per-source
2025-01-15 10:20:24 -05:00
Donald Sharp a6595fde70
Merge pull request #17850 from Jafaral/wr-rpg
pimd: always write cand-rp group config even when rp is inactive
2025-01-14 12:41:15 -05:00
Jafar Al-Gharaibeh 8e66f821bf pimd: always write cand-rp group config even when rp is inactive
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 23:34:08 -06:00
Jafar Al-Gharaibeh cda66453c1 pimd: explicitly ensure the RP src is BSR
With the recent suppoort of multiple sources of RPs, we can assume non static RPs
are BSR RPs. Just make the check explicit for BSR.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:18:24 -06:00
Jafar Al-Gharaibeh c30a3ad890 pimd: fix BSR RPs timing out
On the BSR node itself, RPs shouldn't timeout, becase we know
the node is the BSR, and it is active!

fixes:#17587

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:18:24 -06:00
Nathan Bahr e8d81ab5ce pimd: Implement rpf lookup mode as a list
Add the support to store lookup modes as a sorted list.
List is non-unique and sorts mode with both lists < modes with one list < global mode (no lists).
This way, when finding the right mode, we will match a lookup using a prefix list before the global mode.
Add passing group address into all lookups (using nht cache and/or synchronous lookup).
Many areas don't have a group address, use PIMADDR_ANY if no valid group is needed.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-09 21:58:22 +00:00
Nathan Bahr 8b00575fbb pimd,yang: Expand rpf-lookup-mode command
Add options for group-list and source-list, both of which take a prefix list name.
The prefix list is used to determine the lookup mode for specific sources and/or groups.
Any number of lookup modes can be configured as long as the combination of group
and source list is unique.
A global lookup mode (empty group and source lists) is always added and defaults to mrib-then-urib
as it currently functions. The global lookup mode can be changed as it current exists with the command
`rpf-lookup-mode MODE`.
When determinig which mode to use, match source (and group if provided) against the lists, if they are set.
If a lookup does not specify a group, then only use lookup modes that do not have a group list defined.
A lookup by definition will have a source, so no special handling there.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-09 21:58:22 +00:00