summaryrefslogtreecommitdiffstats
path: root/pimd/pim_bsm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pimd: Process no-forward BSM packetSarita Patra2023-04-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Topology Used: ============= Cisco---FRR4----FRR2 Initially PIM nbr is down between FRR4----FRR2 from FRR2 side Cisco is sending BSR packet to FRR4. Problem Statement: ================= No shutdown the PIM neighbor on FRR2 towards FRR4. FRR2, receives BSR packet immediately as the new neighbor comes up. This BSR packet is having no-forward bit set. FRR2 is not able to process the BSR packet, and drop the BSR packet. Root Cause: ========== When PIMD comes up, we start BSM timer for 60 seconds. Here, the value accept_nofwd_bsm is setting to false. FRR2, when receives no-forward BSR packet, it is getting accept_nofwd_bsm value as false. So, it drops, the no-forward BSM packet. Fix: === Set accept_nofwd_bsm as false after first BSM packet received. Signed-off-by: Sarita Patra <saritap@vmware.com>
* *: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp2023-03-241-9/+9
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-4/+4
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Rename `struct thread` to `struct event`Donald Sharp2023-03-241-2/+2
| | | | | | | | | 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>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-15/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: fix unaligned accessesDavid Lamparter2022-07-121-8/+9
| | | | | | | | | | These are in packed structs at weird offsets (e.g. 2 bytes), and as such need a memcpy to get them into proper alignment. It'd be even better if the pimd code used proper de/serialization, but let's get this improved one step at a time. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: IPV6 adjust in hash_calc_on_grp_rpsarita patra2022-07-071-1/+11
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* Revert "pim6d: IPv6-adjust BSM code"sarita patra2022-07-071-6/+1
| | | | This reverts commit 809c11a9d87e0d12a5c3d3ca6906bc398a58de6c.
* pim6d: remove unused variable neigh_src_strsarita patra2022-07-071-5/+4
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: add pimv6 support for bsmmsg_grpinfosarita patra2022-07-071-20/+14
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: add pimv6 support for bsmmsg_rpinfosarita patra2022-07-071-12/+7
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: add pimv6 support for bsm_hdrsarita patra2022-07-071-11/+10
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: Add pim_addr rp_addr in bsm_rpinfosarita patra2022-07-071-11/+8
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: bsr nht handling for IPV6sarita patra2022-07-071-0/+1
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: modify in_addr current_bsr to pim_addr current_bsrsarita patra2022-07-071-7/+6
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pim6d: Pass pim_addr for pim_nht callbacks.sarita patra2022-07-061-1/+1
| | | | | | | 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>
* pim6d: Adjust rpf_addr in rp_infosarita patra2022-07-061-6/+4
| | | | | | | | 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>
* pimd: Disable receiving BSM on passive interfacesarita patra2022-05-131-0/+8
| | | | Signed-off-by: sarita patra <saritap@vmware.com>
* pimd: Handling BSM send statistics for passive interfacesarita patra2022-05-131-2/+4
| | | | | | | Increment pim_ifstat_bsm_tx only when interface is passive disabled. Signed-off-by: sarita patra <saritap@vmware.com>
* *: Fix spelling of accomodateDonald Sharp2022-04-191-3/+3
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Fix spelling of atleastDonald Sharp2022-04-191-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pim6d: include IPv6 pseudoheader in TX checksumsDavid Lamparter2022-03-281-6/+11
| | | | | | Lots of passing src/dst around, but it is what it is. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: Parse BSM packet for PIMv6Mobashshera Rasool2022-03-251-9/+7
| | | | | | | Modify pim_bsm_process to accomodate v4 and v6 address for parsing the received packet. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* pim6d: Modify pim_rp_del for PIMv4/PIMv6Mobashshera Rasool2022-03-081-1/+1
| | | | Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* pim6d: Add pim_get_all_mcast_group apiMobashshera Rasool2022-03-081-2/+3
| | | | | | | | 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>
* pim6d: Modify pim_rp_change api for pimv6Mobashshera Rasool2022-03-081-2/+1
| | | | Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* Merge pull request #10657 from patrasar/pim_remove_in_addr_noneDavid Lamparter2022-03-021-5/+4
|\ | | | | | | | | | | [manual merge to edit comment, didn't want to incur another cycle] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * pimd: replace inaddr_none with PIMADDR_ANYsarita patra2022-03-011-5/+4
| | | | | | | | | | | | | | 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>
* | pim6d: Adding show running for ipv6 mld commandsSai Gomathi N2022-02-281-2/+2
| | | | | | | | Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* | Merge pull request #10400 from opensourcerouting/pim6-compilefixDonald Sharp2022-02-261-1/+6
|\ \ | | | | | | pim6d: get running with ipv6 types throughout
| * | pim6d: IPv6-adjust BSM codeDavid Lamparter2022-02-161-1/+6
| |/ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* / *: Change thread->func to return void instead of intDonald Sharp2022-02-241-7/+4
|/ | | | | | | 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>
* pim6d: IPv6-adjust pim_msg_send() and relatedDavid Lamparter2022-02-141-5/+4
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: IPv6-adjust iface primary/DR addrsDavid Lamparter2022-02-141-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: IPv6-adjust neigh->source_addrDavid Lamparter2022-02-141-6/+3
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: IPv6-adjust various pim_sgaddr usesDavid Lamparter2022-02-141-4/+1
| | | | | | | Since `pim_sgaddr` is `pim_addr` now, that causes a whole lot of fallout anywhere S,G pairs are handled. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #10292 from opensourcerouting/pim6-addr-auxDonald Sharp2022-02-081-1/+1
|\ | | | | pimd: start tackling IPv6 address operations
| * pimd: move, rename and deploy pim_addr_is_any()David Lamparter2022-01-171-1/+1
| | | | | | | | | | | | | | | | | | 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>
* | pim: Use INADDR_ANY for current_bsr checking is valid yetDonald Sharp2022-02-041-6/+3
| | | | | | | | | | | | | | In all places that pim_nht_bsr_del is called, the code needs to not unregister if the current_bsr is INADDR_ANY. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | pimd: Only remove bsr NHT if we actually have tracked somethingDonald Sharp2022-02-041-1/+2
|/ | | | | | | | | | | | | | I'm now seeing in my log file: 2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0 2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0 2022/01/28 11:20:06 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0 When I run pimd. Looking at the code there are 3 places where pim_bsm.c removes the NHT BSR tracking. In 2 of them the code ensures that the address is already setup in 1 place it is not. Fix. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd : packet processing optimization on rp changeMobashshera Rasool2021-11-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem Statement: ================== on rp_change, PIM processes all the upstream in a loop and for selected upstreams PIM has to send join/prune based on the RPF changed. join and prune packets are not getting aggregated in a single packet. Root Cause Analysis: ==================== on pim_rp_change pim_upstream_update() gets called for selected upstreams. This API calculates to whom it has to send join and to whom it has to send prune via API pim_zebra_upstream_rpf_changed(). This API peprares the upstream_switch_list list per interface and inserts the group and sources. Now PIM is still in the pim_upstream_update() API context, i.e PIM is still processing the same upstream. In the last there is a call to pim_zebra_update_all_interfaces() which processes the upstream_switch_list list, sends the packets out and clears the list. Fix: ==== Don't process the upstream_switch_list in the upstream context. process all the upstreams prepare the upstream_switch_list and then process in one go. This will club all the S,G entries. It also saves list cleanup with respect to memory allocation and deallocation multiple times. Signed-off-by: Vishal Dhingra <rac.vishaldhingra@gmail.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* pimd: correctly process rp-count==0 BSMsDavid Lamparter2021-11-171-12/+26
| | | | | | | | | | | rp-count==0 isn't a broken BSM, it just means the BSR no longer has any Candidate RPs for the group range. Previous behavior is badly mistaken since it stops processing the entire packet. Fix to correctly remove group range on rp-count==0 and continue processing remainder of the packet. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: move BSM clear into BSM codeDavid Lamparter2021-11-171-5/+121
| | | | | | | ... where it actually belongs. And make a bunch of stuff static, since it's no longer used across files now. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: clean up BSR NHT & fix parallel linksDavid Lamparter2021-11-171-78/+17
| | | | | | | | | | | The Bootstrap message RX path needs a RPF check for the BSR address, and this is implemented both incorrectly as well as quite ugly. Clean up and fix case when we have multiple interfaces to the same LAN and/or ECMP nexthops (both would cause message duplication, the former can even cause BSM forwarding loops.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: clean up ifp-by-local-address function(s)David Lamparter2021-11-171-2/+2
| | | | | | | | | | | | | Most users of if_lookup_address_exact only cared about whether the address is any local address. Split that off into a separate function. For the users that actually need the ifp - which I'm about to add a few of - change it to prefer returning interfaces that are UP. (Function name changed due to slight change in behavior re. UP state, to avoid possible bugs from this change.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: de-circularize includesDavid Lamparter2021-08-271-0/+1
| | | | | | | pimd's include files are very interdependent. Let's chop that down a bit to gain some flexibility. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: Prevent memory leakDonald Sharp2021-08-131-2/+5
| | | | | | | | | | When we decide that we do not need a item on the partial_bsrp_list don't just drop the memory on the floor, free it up. This was happening when we decided that a pending item has a hold time of 0. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlenDonatas Abraitis2021-07-011-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp2021-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | VRF creation can happen from either cli or from knowledged about the vrf learned from zebra. In the case where we learn about the vrf from the cli, the vrf id is UNKNOWN. Upon actual creation of the vrf, lib/vrf.c touches up the vrf_id and calls pim_vrf_enable to turn it on properly. At this point in time we have a pim->vrf_id of UNKNOWN and the vrf->vrf_id of the right value. There is no point in duplicating this data. So just remove all pim->vrf_id and use the vrf->vrf_id instead since we keep a copy of the pim->vrf pointer. This will remove some crashes where we expect the pim->vrf_id to be usable and it's not. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: cleanup & convert bsm_rpinfo to TS listDavid Lamparter2021-05-031-65/+49
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>