summaryrefslogtreecommitdiff
path: root/pimd
AgeCommit message (Collapse)Author
2025-04-08pimd: 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> (cherry picked from commit 521b58945ca5c8c75ccdb1f7f1cb9e2eb10ab83f)
2025-04-03pimd: Initialize gm proxy to falseNathan Bahr
Signed-off-by: Nathan Bahr <nbahr@atcorp.com> (cherry picked from commit 153d9ea3b99d07015191924866ae14bb0525365a)
2025-03-06pimd: 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> (cherry picked from commit 374c8dc4dbc8a560036fecdfb3213f690099b869)
2025-02-26Merge pull request #18207 from FRRouting/mergify/bp/dev/10.3/pr-17666Donald Sharp
pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED sta… (backport #17666)
2025-02-25Merge pull request #18244 from FRRouting/mergify/bp/dev/10.3/pr-18225Donald Sharp
pim: Fix autorp group joins (backport #18225)
2025-02-25Merge pull request #18246 from FRRouting/mergify/bp/dev/10.3/pr-18226Donald Sharp
pim: Fix vrf binding of autorp and mroute socket (backport #18226)
2025-02-24pimd: 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> (cherry picked from commit 5a01011e0d2db538a8ba523904bd4f08b786edfb)
2025-02-24pim: 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> (cherry picked from commit 7e181a771c2e525aeda6e8f6c2d58e9ee2503949)
2025-02-24pim: 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> (cherry picked from commit d840560b74e3a6117aa1e4b1203dcdd8fb254ef6)
2025-02-20pimd: 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> (cherry picked from commit 51f26d17da288af44a8a0e536dbe317a7e678514)
2025-02-20pimd: 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> (cherry picked from commit 8280257cc99e071c205e469399f2fb41671b30eb)
2025-02-12Merge pull request #18056 from FRRouting/mergify/bp/dev/10.3/pr-18048Donald Sharp
pimd: fix DR election race on startup (backport #18048)
2025-02-07pimd: 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> (cherry picked from commit 86445246062583197d4a6dff7b8c74003cd8049d)
2025-02-07pimd: 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> (cherry picked from commit afed39ea2be25bf30d50ac49b4edf424deadcb17)
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> (cherry picked from commit d1440dadffe90dc743c5b83126b021d7a4a08766)
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>
2024-12-06pimd,yang: Extend multicast boundary functionalityCorey Siltala
Add new interface command ip multicast boundary ACCESSLIST4_NAME. This allows filtering on both source and group using the extended access-list syntax vs. group-only as with the existing "ip multicast boundary oil" command, which uses prefix-lists. If both are configured, the prefix- list is evaluated first. The default behavior for both prefix-lists and access-lists remains "deny", so the prefix-list must have a terminating "permit" statement in order to also evaluate against the access-list. The following example denies groups in range 229.1.1.0/24 and groups in range 232.1.1.0/24 with source 10.0.20.2: ! ip prefix-list pim-oil-plist seq 10 deny 229.1.1.0/24 ip prefix-list pim-oil-plist seq 20 permit any ! access-list pim-acl seq 10 deny ip host 10.0.20.2 232.1.1.0 0.0.0.255 access-list pim-acl seq 20 permit ip any any ! interface r1-eth0 ip address 10.0.20.1/24 ip igmp ip pim ip multicast boundary oil pim-oil-plist ip multicast boundary pim-acl ! Signed-off-by: Corey Siltala <csiltala@atcorp.com>
2024-12-06pimd: Move ACL handling to pim_util.cCorey Siltala
Move the extended access-list handling from pim_msdp_packet.c to pim_util.c to allow use elsewhere in the daemon. Signed-off-by: Corey Siltala <csiltala@atcorp.com>
2024-12-05Merge pull request #17570 from btrent98/igmp-proxy-memfixDonald Sharp
pimd: free igmp proxy joins on interface deletion
2024-12-05pimd: implement MSDP peer SA limitingRafael Zalamena
Implement a command to enable/disable per peer MSDP SA limiting. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-05yang,pimd: support shutdown and SA limitRafael Zalamena
Add MSDP shutdown and SA limiting configuration to YANG model. (no implementation, just boiler plate code) Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-04Merge pull request #17502 from opensourcerouting/msdp-shutdownJafar Al-Gharaibeh
pimd: implement MSDP shutdown command