summaryrefslogtreecommitdiff
path: root/pimd/pim_msdp.c
AgeCommit message (Collapse)Author
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-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-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>
2024-12-16Merge pull request #17252 from nabahr/mcast-modeRafael Zalamena
Fix PIMD RPF lookup mode and nexthop tracking
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-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-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-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-11-25pimd: implement MSDP shutdown commandRafael Zalamena
Allow MSDP protocol to be disabled. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-21pimd,yang: log MSDP SA eventsRafael Zalamena
Add new command to log all SA events. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-21pimd,yang: log MSDP neighbor eventsRafael Zalamena
Move MSDP neighbor events global debug to per PIM instance. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-20pimd: constify peer lookup functionRafael Zalamena
Make parameter `const` to document that the variable will not change. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-20pimd: remove temporary variables from MSDP peerRafael Zalamena
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-07-29pimd: add support for MSDP authenticationRafael Zalamena
Implement MSDP MD5 authentication connection support. Implementation details: - Move the MSDP socket creation code to a generic function so it can be parametrized to be used with/without authentication. - The MSDP peer connection will not change when the configuration is set, instead it will only be applied next connection or when `clear ip msdp peer A.B.C.D` is called. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-07-27pimd: MSDP SA filteringRafael Zalamena
Implement MSDP peer incoming/outgoing SA filter. Note ---- Cisco extended access list has a special meaning: the first address is the source address to filter. Example: ! The rules below filter some LAN prefix to be leaked out access-list filter-lan-source deny ip 192.168.0.0 0.0.255.255 224.0.0.0 0.255.255.255 access-list filter-lan-source permit any router pim msdp peer 192.168.0.1 sa-filter filter-lan-source out ! The rules below filter some special management group from being ! learned access-list filter-management-group deny 230.0.0.0 0.255.255.255 access-list filter-management-group permit any router pim msdp peer 192.168.0.1 sa-filter filter-management-group in Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-07-25Merge pull request #16472 from donaldsharp/msdp_bugDonatas Abraitis
pimd: Fix msdp setting of sa->rp
2024-07-25pimd: Fix msdp setting of sa->rpDonald Sharp
The code is clearly incorrect. After consultation with the original author this is the decided change. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-16pimd, lib, vtysh: Added new 'router pim[6] [vrf NAME]' config nodeNathan Bahr
Moved all existing global/vrf PIM config to the new subnode. Existing configuration updated to be hidden and deprecated. Both versions of configuration still work together. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2023-10-04pimd: Indicating the rp in the msdp sa messageAdriano Marto Reis
Indicating the configured PIM Rendezvous Point (RP) in the MSDP SA message The RFC-3618, section 12.2.1, describes the fields included in the MSDP SA message. The "RP address" field is "the address of the RP in the domain the source has become active in". In the most common case, we will establish an MSDP connection from RP to RP. However, there are cases where we want to establish a MSDP connection from an interface/address that is not the RP. Section 3 of RFC-3618 describes that scenario as "intermediate MSDP peer". Moreover, the RP could be another router in the PIM domain - not the one establishing the MSDP connection. The current implementation could be problematic even with a single router per PIM domain. Consider the following scenario: * There are two PIM domains, each one with a single router. * The two routers are connected via two independent networks. Let's say that is to provide redundancy. * The routers are configured to establish two MSDP connections, one on each network (redundancy again). * A multicast source becomes active on the router 1. It will be communicated to router 2 via two independent MSDP SA messages, one per MSDP connection. * Without these changes, each MSDP SA message will indicate a different RP. * Both RP addresses will pass the RPF check, and both MSDP sources will be accepted. * If the router has clients interested in that multicast group, it will send PIM Join messages to both RPs and start receiving the multicast traffic from both. With the changes included in this commit, the multicast source available in router 1 would still be communicated to router 2 twice. But both MSDP SA messages would indicate the same RP, and one of them would be discarded due to failure in the RPF-check failure. Also, the changes allow us to define the RP that will be included in the MSDP SA message, and it could be one of the interfaces used to establish the MSDP connection, some other interface on the router, a loopback interface, or another router in the PIM domain. These changes should not create compatibility issues. As I mentioned, we usually establish MSDP connections from RP to RP. In this case, the result will be the same. We would still indicate the address used to establish the MSDP connection if the RP is not set - I wonder if that should even be a valid configuration. Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-21*: Add a hash_clean_and_free() functionDonald Sharp
Add a hash_clean_and_free() function as well as convert the code to use it. This function also takes a double pointer to the hash to set it NULL. Also it cleanly does nothing if the pointer is NULL( as a bunch of code tested for ). Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06pimd: un-dependency-hell `pim_instance.h`David Lamparter
This is causing build issues on BSD by including (transitively) `linux/mroute6.h` - try to address by disentangling the headers a bunch. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-06pim6d: Adjust mrib_nexthop_addr msdp codesarita patra
In this PR, we are handling the msdp code after mrib_nexthop_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-08Merge pull request #10292 from opensourcerouting/pim6-addr-auxDonald Sharp
pimd: start tackling IPv6 address operations
2022-01-18pimd: remove redundant header includeMobashshera Rasool
Removing redundant header inclusion of pim_cmd.h Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-01-17pimd: remove PIM_INADDR_IS[NOT]_ANY macrosDavid Lamparter
These really don't serve much of a purpose, especially with how inconsistently they're used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: deploy pim_sgaddr_* helpersDavid Lamparter
Use _cmp/_hash/_match helpers for operations on pim_sgaddr to prepare IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: move & deploy pim_addr_cmp() helperDavid Lamparter
Comparing `s_addr` isn't cutting it for IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: move, rename and deploy pim_addr_is_any()David Lamparter
Replaces comparison against INADDR_ANY, so we can do IPv6 too. (Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and type fixed to bool.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_dump()David Lamparter
... and replace with `%pSG` printfrr specifier. This actually used a static buffer in the formatting function, so subsequent formatting would overwrite earlier uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_set()David Lamparter
... and replace with `%pSG` printfrr specifier. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: `prefix_sg` => `pim_sgaddr`David Lamparter
Mostly just 2 sed calls: - `sed -e 's%struct prefix_sg%pim_sgaddr%g'` - `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'` Plus a bunch of fixing whatever that broke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-08pimd: fix msdp mesh grp with wildcard member addrChirag Shah
frr-reload fails to recognize wildcard "*" for member address in frr.conf/runing-config as cli syntax expects in v4 address format. Ticket: #2816923 Testing: Without fix: running config: ip msdp mesh-group foo1 member * Frr reoad failure log: 2021-11-02 11:05:04,317 INFO: Loading Config object from vtysh show running line 5: % Unknown command: ip msdp mesh-group foo1 member * Traceback (most recent call last): File "/usr/lib/frr/frr-reload.py", line 1950, in <module> With fix: -------- running config displays: ip msdp mesh-group foo1 member 0.0.0.0 Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-09-21pimd: Prevent uninited usage of nexthopDonald Sharp
pim_msdp_peer_rpf_check creates an nexthop to do a rpf search against and doesn't initialize it sucht that the pim_nexthop_lookup function is making decisions against the nexthop just created that was uninitialized. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28pimd: fix missing list remove when deleting mesh groupIgor Ryzhov
This leads to a crash when you use "show run" after deleting the group. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-01pimd: support MSDP global timers configurationRafael Zalamena
Users can now configure: * Hold time * Keep alive * Connection retry Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: make function names consistentRafael Zalamena
Rename functions (`pim_msdp_peer_new` => `pim_msdp_peer_add` and `pim_msdp_peer_do_del` => `pim_msdp_peer_del`) to keep consistency and update the `pim_msdp_peer_add` documentation to tell users that this is also used for non meshed group peers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: allow MSDP group name 'default'Rafael Zalamena
Don't assign a default group name for non meshed group peers, instead use a flag. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: rework MSDP northbound integrationRafael Zalamena
Simplify the MSDP handling functions and allow source changes. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-09pimd: rename some MSDP functionsRafael Zalamena
Rename and shorten function names to make them uniform. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-09pimd: rework MSDP mesh-group codeRafael Zalamena
Fully utilize the northbound to hold pointers to our private data instead of searching for data structures every time we need to change a configuration. Highlights: * Support multiple mesh groups per PIM instance (instead of one) * Use DEFPY instead of DEFUN to reduce code complexity * Use northbound private pointers to store data structures * Reduce callback names size Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>