summaryrefslogtreecommitdiff
path: root/pimd
AgeCommit message (Collapse)Author
2025-04-17Merge pull request #18538 from nabahr/autorp-enablingDonald Sharp
pimd: Only create and bind the autorp socket when really needed
2025-04-15Merge pull request #18610 from lsang6WIND/yang-isisdChristian Hopps
fix yang commands that don't have yang attr
2025-04-14Merge pull request #18578 from ak503/pim6_use_sourceJafar Al-Gharaibeh
pim6d: fix missing 'use-source' interface command
2025-04-12pim6d: fix missing 'use-source' interface commandDmitrii Turlupov
Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
2025-04-09Merge pull request #17915 from mjstapp/compile_wshadowDavid Lamparter
2025-04-08pimd: clean up variable-shadow warningsMark Stapp
Clean up -Wshadow warnings in pimd Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08Merge pull request #18526 from donaldsharp/pim_leakageJafar Al-Gharaibeh
pimd: Fix memory leak on shutdown
2025-04-08pimd: add YANG attr to YANG cmdLoïc Sang
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-02pimd: Initialize gm proxy to falseNathan Bahr
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-03-29pimd: Fix memory leak on shutdownDonald Sharp
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-28pimd: Only create and bind the autorp socket when really neededNathan Bahr
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-20pimd:Skip RPF check for SA message received from the MSDP mesh group peersusrivastava-nvidia
Signed-off-by: Utkarsh Srivastava <usrivastava@nvidia.com>
2025-03-20pimd:Setting the flag PIM_MSDP_PEERF_IN_GROUP for MSDP mesh group peersusrivastava-nvidia
Signed-off-by: Utkarsh Srivastava <usrivastava@nvidia.com>
2025-03-05pimd: Fix PIM6 MLD VRF support (use recvmsg() pktinfo)Martin Buck
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-02-28pimd: fix null memory access on IGMP source limitRafael Zalamena
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-24Merge pull request #18216 from gromit1811/bugfix_pim_vrf_registerJafar Al-Gharaibeh
pimd: Fix PIM VRF support (send register/register stop in VRF)
2025-02-24Merge pull request #18226 from nabahr/pim-vrf-bindDonald Sharp
pim: Fix vrf binding of autorp and mroute socket
2025-02-21pim: Fix autorp group joinsNathan Bahr
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-21pim: Fix vrf binding of autorp and mroute socketNathan Bahr
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-21pimd: Fix PIM VRF support (send register/register stop in VRF)Martin Buck
In 946195391406269003275850e1a4d550ea8db38b and 8ebcc02328c6b63ecf85e44fdfbf3365be27c127, 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-20Merge pull request #17666 from routingrocks/pim_fhr_rpMark Stapp
pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED sta…
2025-02-20Merge pull request #14227 from routingrocks/pim_data_fixJafar Al-Gharaibeh
pimd: Fix for data packet loss when FHR is LHR and RP
2025-02-19pimd: allow restricting neighbors per interfaceDavid Lamparter
Just filter incoming packets against a specified prefix-list. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-13pimd,topotests: frrbot styling suggestionsRafael Zalamena
Incorporate frrbot suggestion to avoid the CI warning. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-13pimd: add IGMPv2/MLDv1 immediate-leaveDavid Lamparter
(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-11pimd: Fix for data packet loss when FHR is LHR and RPRajesh Varatharaj
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-10pim6d: implement clear IPv6 MLD interfacesRafael Zalamena
Allow user to reset MLD state on all interfaces in a VRF. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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>
2025-02-06Merge pull request #18048 from opensourcerouting/msdpt3fJafar Al-Gharaibeh
pimd: fix DR election race on startup
2025-02-06Merge pull request #14105 from routingrocks/pim_ageout_fixRafael Zalamena
pimd: Fix for FHR mroute taking longer to age out
2025-02-06pimd: fix DR election race on startupRafael Zalamena
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-06pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED state ↵Rajesh Varatharaj
(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-06pimd: Fix for FHR mroute taking longer to age outRajesh Varatharaj
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-06pimd: fix memory leak and assign allocation typeRafael Zalamena
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-01-27pimd: Close AutoRP socket when not neededNathan Bahr
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-15Merge pull request #17776 from nabahr/group-rpf-modeDonald Sharp
PIMD: RPF lookup mode per-group, per-source
2025-01-14Merge pull request #17850 from Jafaral/wr-rpgDonald Sharp
pimd: always write cand-rp group config even when rp is inactive
2025-01-13pimd: always write cand-rp group config even when rp is inactiveJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13pimd: explicitly ensure the RP src is BSRJafar Al-Gharaibeh
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-13pimd: fix BSR RPs timing outJafar Al-Gharaibeh
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-09pimd: Implement rpf lookup mode as a listNathan Bahr
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-09pimd,yang: Expand rpf-lookup-mode commandNathan Bahr
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>
2024-12-18pim: handle return code to fix a couple of coverity issuesJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-12-16Merge pull request #17252 from nabahr/mcast-modeRafael Zalamena
Fix PIMD RPF lookup mode and nexthop tracking
2024-12-13pimd: Clean up pim RPF/NHT show commandsNathan Bahr
Moved `show ip rpf A.B.C.D` command here from zebra, deprecated and aliased to `show ip pim nexthop-lookup`. Allow group to be optional in the lookup command. Only validate group if source is ANY. Documented setting source via RP if not provided. Added new output if ANY source + group lookup is performed and no RP is found for the group. Updated output to include souce and group for lookup. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13pimd: Update nexthops when lookup mode changesNathan Bahr
Link up the RPF lookup mode changing to a force update to RP's and upstreams registered for nexthop lookup cache updates. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13pimd: Refactor pim NHTNathan Bahr
Refactor the next hop tracking in PIM to fully support the configured RPF lookup mode. Moved many NHT related functions to pim_nht.h/c NHT now tracks both MRIB and URIB tables and makes nexthop decisions based on the configured lookup mode. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13pimd: Refactor synchronous nexthop lookupNathan Bahr
Add prefix length in nexthop response. Apply lookup mode to the sychronous lookups, where we may lookup the MRIB, URIB, or both and make a decision based on the nexthop. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13pimd,yang: Reimplement RPF lookup vty in router pimNathan Bahr
Add rpf-lookup-mode MODE vty command under router pim block. Including NB piping and config write. Using the mode still pending. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>