summaryrefslogtreecommitdiff
path: root/pimd
AgeCommit message (Collapse)Author
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>
2024-12-13Merge pull request #17642 from opensourcerouting/pim-csJafar Al-Gharaibeh
pimd,pim6d: optimize multicast prefix generation and fix coverity scan defect
2024-12-13Merge pull request #17635 from opensourcerouting/pim6-embedded-crashJafar Al-Gharaibeh
pim6d: fix crash on clear ipv6 mroute
2024-12-13pimd,pim6d: optimize multicast prefix generationRafael Zalamena
Fix Coverity Scan CID 1602463: make it impossible for the function to fail. Hardcode the multicast prefix generation instead of calling `str2prefix()` which caused unnecessary memory allocations and returned error values. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-12zebra,pimd,lib: Modify ZEBRA_NEXTHOP_LOOKUP_MRIBNathan Bahr
Modified ZEBRA_NEXTHOP_LOOKUP_MRIB to include the SAFI from which to do the lookup. This generalizes the API away from MRIB specifically and allows the user to decide how it should do lookups. Rename ZEBRA_NEXTHOP_LOOKUP_MRIB to ZEBRA_NEXTHOP_LOOKUP now that it is more generalized. This change is in preperation to remove multicast lookup mode completely from zebra. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-12pimd: support originator id configurationRafael Zalamena
Allow user to specify the RP field for the SA messages. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-12Merge pull request #17636 from opensourcerouting/msdp-cleanupDonald Sharp
pimd: clean up MSDP code
2024-12-11Merge pull request #17605 from donaldsharp/upstream_some_evpnDonatas Abraitis
Upstream some internal code
2024-12-11pimd: move all MSDP code to its own placeRafael Zalamena
Guard MSDP code to compile only on IPv4 and remove all MSDP code from PIMv6. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-11pimd: move MSDP configuration and initializationRafael Zalamena
Reorganize the MSDP initialization code and configuration writing code to its appropriated place. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-11pim6d: ignore more MSDP callbacksRafael Zalamena
PIMv6 does not implement MSDP, users should use PIMv6 embedded RP instead. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-11pim6d: fix crash on clear ipv6 mrouteRafael Zalamena
Fix crash on `clear ipv6 mroute` when using embedded RP. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-10Merge pull request #17521 from opensourcerouting/msdp-sa-limitJafar Al-Gharaibeh
pimd: MSDP per peer SA limit
2024-12-09pimd: skip init of mlag roles based on the zebra capabilities messageAnuradha Karuppiah
Looks like the cap setting was added for testing mlag via zebra test cli to config the mlag role. However it is interfering with the valid state updates rxed from the MLAG daemon based on timing (in some cases the MLAG state changes are rxed before the capabilities). Reference logs - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> root@TORC11:mgmt:/home/cumulus# grep -ri "my_role\|MlagRole" /var/log/frr/bgpd.log 2021/06/18 13:26:40.380130 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: SECONDARY, peer_state: DOWN 2021/06/18 13:26:40.380766 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: SECONDARY, peer_state: DOWN 2021/06/18 13:26:41.382258 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: SECONDARY, peer_state: RUNNING 2021/06/18 13:26:41.382379 PIM: pim_mlag_process_mlagd_state_change: msg dump: my_role: PRIMARY, peer_state: RUNNING 2021/06/18 13:26:52.386071 ZEBRA: Sending capabilities to client pim: MPLS enabled numMultipath 128 GR disabled MaintMode off MlagRole 0 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Ticket: #2691629 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2024-12-06pimd: Convert boundary_oil_plist to struct prefix_listCorey Siltala
Rather than storing the prefix-list name and looking it up every time we use it, store a pointer to the prefix-list itself. Signed-off-by: Corey Siltala <csiltala@atcorp.com>