summaryrefslogtreecommitdiff
path: root/pimd/pim_rp.c
AgeCommit message (Collapse)Author
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: 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,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-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-11-18pim6d: fix coverity scan warningRafael Zalamena
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-13pimd: fix check-patch warningRafael Zalamena
Remove unnecessary braces. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-13pim6d: support embedded-rpRafael Zalamena
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-09-24pimd: Add AutoRP functionality to PIMDNathan Bahr
Perform AutoRP discovery and candidate RP announcements using the AutoRP protocol. Mapping agent is not yet implemented, but this feature is not necessary for FRR to support AutoRP as we only need one AutoRP mapping agent in the network. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-09-01*: Create termtable specific temp memoryDonald Sharp
When trying to track down a MTYPE_TMP memory leak it's harder to search for it when you happen to have some usage of ttable_dump. Let's just give it it's own memory type so that we can avoid confusion in the future. 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>
2024-06-26pimd: refactor `pim_rp_set_upstream_addr`David Lamparter
Somehow this tiny function ended up being written in a very convoluted way that enabled the braces mixup in the previous commit. Rewrite it to be less confusing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-26pimd: fix misplaced braces/logic errorDavid Lamparter
The `!rp_info ||` check got added during a cleanup pass. Unfortunately the braces/and/or combination is not correct :( Fixes: b1945363fbf ("pimd: Various buffer overflow reads and crashes") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20pimd: add debugs for i-am-RP stateDavid Lamparter
This proved helpful in debugging the Candidate-RP code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-11pimd: Make some not very needed debugs more restrictiveDonald Sharp
When turning on debug pim trace, there are lots of messages surrounding the timing of rpf lookup. 99% of the time no-one cares about these anymore. Let's make them not seen unless we turn up debugs 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-28pimd, pim6d: Don't track nexthop for RP 0.0.0.0 & 0::0Sarita Patra
Topology: ======== FHR----Source Problem: ======= When FHR receives multicast traffic, there is no RP configured, PIMD does NHT register for RP address 0.0.0.0 and group 224.0.0.0/4 PIM6D does NHT register for RP address 0::0 and group FF00::0/8 frr# show ip pim nexthop Number of registered addresses: 1 Address Interface Nexthop --------------------------------------------- frr# show ipv6 pim nexthop Number of registered addresses: 1 Address Interface Nexthop --------------------------------------------- Fix: ==== Dont track nexthop for RP 0.0.0.0 & 0::0. frr# show ip pim nexthop Number of registered addresses: 0 frr# show ipv6 pim nexthop Number of registered addresses: 0 Issue: #12104 Signed-off-by: Sarita Patra <saritap@vmware.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-10-25pimd, pim6d: Fix rp-info OIF having PIM disabled interfaceSarita Patra
Problem: frr(config)# show ip pim rp-info RP address group/prefix-list OIF I am RP Source Group-Type 109.0.0.3 224.0.0.0/4 ens192 no Static ASM frr(config)# int ens192 frr(config-if)# no ip pim frr(config) show ip pim rp-info RP address group/prefix-list OIF I am RP Source Group-Type 109.0.0.3 224.0.0.0/4 ens192 no Static ASM rp-info OIF is still having ens192 which is PIM disabled. Fixing this as part of this PR. Issue: #12044 Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-08-16pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim rp-info" command ↵Abhishek N R
output. Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-07-12pimd,pim6d: Set RP to true if the address matches, ignore prefix-lengthMobashshera Rasool
The API pim_rp_check_interface_addrs checks if the RP address matches with the primary address then it returns true. In case of PIMv4 this condition is true, therefore the router becomes RP. But in case of PIMv6, this condition does not pass because primary address for PIMv6 is link-local address. Also PIMv4 allows secondary addresses to be used as RP if it is a host route in case primary does not match. Fixing it by only checking the configured RP address with the interface address and ignoring the prefix length since it does not matter. Fixes: #11335 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-07-06pim6d: Pass pim_addr for pim_nht callbacks.sarita patra
For pim callbacks, we pass pim_addr as value, not pointer. So making it consistent for pim_nht callbacks. Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06pim6d: Adjust rpf_addr in rp_infosarita patra
In this PR, we are handling the rp_info after rpf_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-06-14pimd: Cleanup rpf lookup debug to help us figure out what is going onDonald Sharp
The rpf lookup debug was not taking into account the fact that a prefix-list might be applied and also we might need to make a choice between the two. So let's give ourselves a bit more data. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-26pimd: Allow the LPM match work properly with prefix lists and normal rp'sDonald Sharp
All rp_info's are being saved in the pim->rp_list and the non prefix-list rp's are supposed to be saved in table pim->rp_table. What was happening, though, is that all the plists were being stored at the 224.0.0.0/4 node of the tree(irrelevant to the fact that we should not be looking up the non-prefix list rp's in the table) and since we can have multiple prefix lists and only one rp_info stored at the 224.0.0.0/4 node of the tree, there can be situations where the 224.0.0.0/4 node can be overwritten due to the order entered. As such there exists situations where command enter ordering will cause what we match to, change in pim_rp_find_match_group. Fixes: a) Do not store prefix list based rp_info's in the pim->rp_table b) In pim_rp_find_match_group, ensure that the node lookup does not correspond to a prefix list based node. c) When in the situation there are both: ip pim rp 4.5.6.7 224.0.0.0/16 ip pim rp 5.6.67.8 prefix-list FOO ip prefix-list FOO permit 224.0.1.0/24 and we receive a group for 224.0.1.5, we were comparing the 224.0.0.0/16 to the 224.0.0.0/4 of the 5.6.67.8 group, when FRR should have been comparing to entry that matched in the prefix-list Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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-03-28pim6d: Implementing "show ipv6 pim rp-info" CLIAbhishek N R
Adding new show CLI to display pim RP information. Also corrected ipv4 json object. Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-17pimd: Show all groups matched by an arbitrary prefix for `pim rp-info`Donatas Abraitis
``` r1# show ip pim rp-info RP address group/prefix-list OIF I am RP Source Group-Type 192.168.10.123 225.0.0.0/24 eth2 yes Static ASM 192.168.10.123 239.0.0.0/8 eth2 yes Static ASM 192.168.10.123 239.4.0.0/24 eth2 yes Static SSM r1# show ip pim rp-info 239.4.0.0/25 RP address group/prefix-list OIF I am RP Source Group-Type 192.168.10.123 239.0.0.0/8 eth2 yes Static ASM 192.168.10.123 239.4.0.0/24 eth2 yes Static SSM ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-12pimd: Show group-type under `show ip pim rp-info`Donatas Abraitis
And filter by group for PIM. ``` exit1-debian-11# show ip pim rp-info RP address group/prefix-list OIF I am RP Source Group-Type 192.168.10.17 238.0.0.0/24 eth2 no Static ASM 192.168.10.110 232.0.0.0/24 eth2 no Static SSM exit1-debian-11# show ip pim rp-info 238.0.0.0/24 RP address group/prefix-list OIF I am RP Source Group-Type 192.168.10.17 238.0.0.0/24 eth2 no Static ASM exit1-debian-11# show ip pim rp-info 238.0.0.0/24 json { "192.168.10.17":[ { "rpAddress":"192.168.10.17", "outboundInterface":"eth2", "iAmRP":false, "group":"238.0.0.0/24", "source":"Static", "groupType":"ASM" } ] } exit1-debian-11# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-11pim6d: fix some IPv6 confusion in RP codeDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11pimd: RP code indentation adjustmentDavid Lamparter
Need to fix some bits here and running into the "80-ch wall". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-08pim6d: Modify pim_rp_find_exact and pim_rp_find_match_groupMobashshera Rasool
Modify the apis to accomodate IPv4 and IPv6 addreses for RP. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_del for PIMv4/PIMv6Mobashshera Rasool
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_find_prefix_list for PIMv6Mobashshera Rasool
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_g for PIMv4/PIMv6Mobashshera Rasool
Modify pim_rp_g to support PIMv6. Remove it from stub. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_i_am_rp for PIMv4/PIMv6Mobashshera Rasool
Remove pim_rp_i_am_rp from stub for PIMv6. Modify pim_rp_i_am_rp for both the daemons. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_set_upstream_addr for PIMv4/PIMv6Mobashshera Rasool
Modify pim_rp_set_upstream_addr for supporting PIMv4 and PIMv6. Removed the stub api for PIMv6. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Add pim_get_all_mcast_group apiMobashshera Rasool
Added this api to fill all multicast group address based on IP version. For PIMv4 its 224.0.0.0/4, for PIMv6 its FF00::0/8. Changed the code where its being used currently. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_change api for pimv6Mobashshera Rasool
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Modify pim_rp_new for pimv6Mobashshera Rasool
Modify the api pim_rp_new to accomodate pimv6 changes. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Return type and parameter changes for api pim_rp_del_configMobashshera Rasool
1. Return value of this function pim_rp_del_config is nowhere used. So made it as a void function. 2. Paramater const char *rp is first converted to string from prefix in the caller and then back to prefix in this api pim_rp_del_config. Fixed it by directly passing the address instead of string. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08pim6d: Adding the rp clis to show-runningMobashshera Rasool
Modify the pim_rp_config_write api for pimv4/pimv6. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-02Merge pull request #10657 from patrasar/pim_remove_in_addr_noneDavid Lamparter
[manual merge to edit comment, didn't want to incur another cycle] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02pimd: fix stray comment referencing INADDR_NONEDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-01pimd: replace inaddr_none with PIMADDR_ANYsarita patra
We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr when there is no rp configured for group_all. Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-16pim6d: remove `PIM_V6_TEMP_BREAK`David Lamparter
It's no longer necessary, pim6d now compiles without this hack. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust iface primary/DR addrsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust pim_upstream addrDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust neigh->source_addrDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: prepare/stub pim_rp_* functions for IPv6David Lamparter
These are sprinkled relatively widely through the PIM codebase, so for the time being reduce the "compiler warning surface" by moving them forward to proper types without actual implementations. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>