Commit Graph

2910 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
c51452d476 pim: handle return code to fix a couple of coverity issues
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-12-18 21:52:48 -06:00
Rafael Zalamena
3bebb7be92
Merge pull request #17252 from nabahr/mcast-mode
Fix PIMD RPF lookup mode and nexthop tracking
2024-12-16 09:57:31 -03:00
Nathan Bahr
5cce666d49 pimd: Clean up pim RPF/NHT show commands
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-13 17:36:34 +00:00
Nathan Bahr
9ce7f9b8e8 pimd: Update nexthops when lookup mode changes
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-13 17:36:34 +00:00
Nathan Bahr
6d30c8f6b5 pimd: Refactor pim NHT
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-13 17:36:34 +00:00
Nathan Bahr
cc865c0192 pimd: Refactor synchronous nexthop lookup
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-13 17:36:34 +00:00
Nathan Bahr
10e2df6530 pimd,yang: Reimplement RPF lookup vty in router pim
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-13 17:36:34 +00:00
Jafar Al-Gharaibeh
27b01ce68c
Merge pull request #17642 from opensourcerouting/pim-cs
pimd,pim6d: optimize multicast prefix generation and fix coverity scan defect
2024-12-13 09:37:07 -06:00
Jafar Al-Gharaibeh
330e2c68e1
Merge pull request #17635 from opensourcerouting/pim6-embedded-crash
pim6d: fix crash on clear ipv6 mroute
2024-12-13 09:36:28 -06:00
Rafael Zalamena
a507ca1163 pimd,pim6d: optimize multicast prefix generation
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-13 08:28:42 -03:00
Nathan Bahr
4250eae00d zebra,pimd,lib: Modify ZEBRA_NEXTHOP_LOOKUP_MRIB
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-12 13:50:31 +00:00
Rafael Zalamena
74834a92f6 pimd: support originator id configuration
Allow user to specify the RP field for the SA messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-12 10:34:19 -03:00
Donald Sharp
f170e9bba9
Merge pull request #17636 from opensourcerouting/msdp-cleanup
pimd: clean up MSDP code
2024-12-12 08:28:49 -05:00
Donatas Abraitis
024c9446a5
Merge pull request #17605 from donaldsharp/upstream_some_evpn
Upstream some internal code
2024-12-11 18:15:09 +02:00
Rafael Zalamena
d4da6316c7 pimd: move all MSDP code to its own place
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-11 11:58:25 -03:00
Rafael Zalamena
6d759deea1 pimd: move MSDP configuration and initialization
Reorganize the MSDP initialization code and configuration writing code
to its appropriated place.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-11 11:58:25 -03:00
Rafael Zalamena
74623166d4 pim6d: ignore more MSDP callbacks
PIMv6 does not implement MSDP, users should use PIMv6 embedded RP
instead.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-11 11:58:25 -03:00
Rafael Zalamena
3b0b1adad7 pim6d: fix crash on clear ipv6 mroute
Fix crash on `clear ipv6 mroute` when using embedded RP.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-11 10:39:36 -03:00
Jafar Al-Gharaibeh
ccb57ad10f
Merge pull request #17521 from opensourcerouting/msdp-sa-limit
pimd: MSDP per peer SA limit
2024-12-10 11:36:50 -06:00
Anuradha Karuppiah
e57ad2fbcd pimd: skip init of mlag roles based on the zebra capabilities message
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-09 12:31:29 -05:00
Corey Siltala
8465ba1dde pimd: Convert boundary_oil_plist to struct prefix_list
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-06 14:44:52 -06:00
Corey Siltala
4de4017d64 pimd,yang: Extend multicast boundary functionality
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-06 14:44:17 -06:00
Corey Siltala
a9bee74ea2 pimd: Move ACL handling to pim_util.c
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-06 14:44:17 -06:00
Donald Sharp
a43b11fcf6
Merge pull request #17570 from btrent98/igmp-proxy-memfix
pimd: free igmp proxy joins on interface deletion
2024-12-05 10:23:30 -05:00
Rafael Zalamena
a38ed18a4e pimd: implement MSDP peer SA limiting
Implement a command to enable/disable per peer MSDP SA limiting.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-05 10:38:52 -03:00
Rafael Zalamena
c8ded86e9e yang,pimd: support shutdown and SA limit
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-05 10:35:10 -03:00
Jafar Al-Gharaibeh
59b0a6e339
Merge pull request #17502 from opensourcerouting/msdp-shutdown
pimd: implement MSDP shutdown command
2024-12-04 21:57:18 -06:00
Jafar Al-Gharaibeh
7c8cef4891
Merge pull request #17578 from donaldsharp/pim_autorp_prevent_crash
pimd: Prevent crash of pim when auto-rp's socket is not initialized
2024-12-04 14:40:25 -06:00
Barry A. Trent
693a37ab04 pimd: free igmp proxy joins on interface deletion
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-12-04 10:51:54 -08:00
Donald Sharp
37b88191fb pimd: Prevent crash of pim when auto-rp's socket is not initialized
If the socket associated with the auto-rp fails to initialize then
the memory for the auto-rp is just dropped on the floor.  Additionally
any type of attempt at using the feature will just cause pimd to crash,
when the pointer is derefed.  Since it is derefed all over the place
without checking.

Clearly if you cannot bind/use the socket let's allow continuation.

Fixes: #17540
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-04 10:49:49 -05:00
Donald Sharp
6bf4283421
Merge pull request #17569 from btrent98/igmp-proxy-bugfix
pimd: igmp proxy joins should not be written as part of config
2024-12-04 08:16:24 -05:00
Barry A. Trent
d4b8a98019 pimd: igmp proxy joins should not be written as part of config
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-12-03 13:44:08 -08:00
Corey Siltala
d21a993f16 pimd: Fix access-list memory leak in pimd
Reset access-lists in pimd on terminate

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
2024-11-26 10:47:46 -06:00
Rafael Zalamena
379dc9ee2f pimd: implement MSDP shutdown command
Allow MSDP protocol to be disabled.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-25 19:23:33 -03:00
Rafael Zalamena
a3e04a86d2
Merge pull request #17340 from nabahr/mapping-agent
PIMD: Implement AutoRP mapping-agent
2024-11-21 16:10:42 -03:00
Rafael Zalamena
fc39bfaa0a pimd,yang: log MSDP SA events
Add new command to log all SA events.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-21 10:26:16 -03:00
Rafael Zalamena
21d1e85db5 pimd,yang: log MSDP neighbor events
Move MSDP neighbor events global debug to per PIM instance.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-21 10:26:16 -03:00
Rafael Zalamena
1e0629fd04 pimd: constify peer lookup function
Make parameter `const` to document that the variable will not change.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-20 12:06:11 -03:00
Rafael Zalamena
8f829b2495 pimd: remove temporary variables from MSDP peer
Remove from MSDP peer data structure two temporary variables
that should only be used when calling library functions.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-20 12:06:00 -03:00
Nathan Bahr
b6aa71b59b pimd: Implement autorp mapping agent
Fully flushed out the AutoRP implementation now with the AutoRP mapping agent.
This touched most of AutoRP in order to have common reuse of containers for each
section of AutoRP operation (Candidate RP announcement, Mapping agent, Discovery).
Many debugs had guards added and many more debug logs added.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-19 22:33:11 +00:00
Nathan Bahr
a060c72530 pimd: Implement autorp mapping agent CLI
Also exposes BSR cand_addrsel methods for use in AutoRP.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-19 22:33:11 +00:00
Nathan Bahr
bd9331e0ae pimd,yang: Add PIMD northbound/yang for AutoRP mapping agent
Reuses the candidate selection logic from BSR configuration

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-19 22:33:11 +00:00
Rafael Zalamena
3066f48eb8 pim6d: fix coverity scan warning
Fix Coverity Scan CID 1601875: use the return value to tell user about
the availability of a next hop to the learned RP (needs debug enabled).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-18 09:17:32 -03:00
Rafael Zalamena
2add05a634 pimd: prevent invalid memory access
Signalize termination to functions so they can avoid accessing pointers
that might be no longer available.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-13 12:05:35 -03:00
Rafael Zalamena
2941f579f7 pimd: fix check-patch warning
Remove unnecessary braces.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-13 12:05:35 -03:00
Rafael Zalamena
3b1fc6fb44 pim6d: fix channel oil leak on embedded RP
When a multicast route is created with embedded RP the channel oil
never gets decremented when `clear ipv6 mroute` is called.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-13 12:05:35 -03:00
Rafael Zalamena
23c7acd232 pim6d: support embedded-rp
Implement embedded RP support and configuration commands.

Embedded RP is disabled by default and can be globally enabled with the
command `embedded-rp` in the PIMv6 configuration node.

It supports the following options:
- Embedded RP maximum limit
- Embedded RP group filtering

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-13 12:05:35 -03:00
Donatas Abraitis
200d54f54e
Merge pull request #17216 from Jafaral/fix-bsr
pimd, tests: fix bsr assert and expand topotest to pimv6
2024-10-27 21:11:23 +02:00
Jafar Al-Gharaibeh
4e74183d0f pimd: allow a bsr with higher priority to take over
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-25 09:00:50 -05:00
Jafar Al-Gharaibeh
8fbd88c5a7 pimd: allow resolving bsr via directly connected secondary address
This only matters to single hop nodes that are adjacent to the bsr. More common
with IPv6 where LL address is used in PIM as the primary address. If the BSR IP
happens to be an address on the same interface, the receiving pim router
rejects the BSR address because it expects the BSR IP to resolve via the LL address
even if we have a connected route for the same BSR IP subnet. Effectively, we want to
allow rpf to be resolved via secondary IPs with connected routes on the same interface,
and not limit them to primary addresses.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-25 08:59:17 -05:00