summaryrefslogtreecommitdiffstats
path: root/pimd/pim_upstream.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pimd: Use a better name for oil_parentDonald Sharp2023-09-191-1/+1
| | | | | | | | | Use oil_incoming_vif instead of oil_parent. I had to go look this up as that I failed to remember that the linux kernel calls this parent for some bizarre reason. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: Intentionally rescan oil when RPF fails on upstream creationDonald Sharp2023-08-141-0/+1
| | | | | | | | | | | | | When pim is creating an upstream for a S,G that it has received *but* it has not received a route to the S, the oil is not scanned to see if it should inherit anything from the *,G that may be present when it cannot find the correct iif to use. When the nexthop tracking actually resolves the route, the oil is never rescanned and the S,G stream will be missing a correct oil list leading to absolute mayhem in the network. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd, pim6d: Don't set SRC_STREAM flag on LHRSarita Patra2023-07-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setup: ------ R1( LHR) ---------R2( RP) ----------R3( FHR) Problem: ------- - Send IGMP/MLD join and traffic. LHR: (S,G) mroute is created with reference count = 2 and set the flag SRC_STREAM. (Code flow: pim_mroute_msg_wholepkt -> pim_upstream_add, pim_upstream_sg_running_proc -> pim_upstream_ref) - Send IGMP/MLD prune. LHR: removes (*,G) entry and it tries to remove childen (S,G) entries. But (S,G) is having reference count = 2. So after prune, (S,G) entry reference count becomes 1 and will be present until KAT expires. Fix: --- Don't set SRC_STREAM flag for LHR. In LHR, (S,G) should be maintained, until (*,G) is present. When prune receives delete (*,G) and children (S,G). When traffic stops, delete (S,G) after KAT expires. Issue: #13893 Signed-off-by: Sarita Patra <saritap@vmware.com>
* pim, pim6d: pimreg interface is not getting added in a certain scenarioSai Gomathi N2023-06-211-0/+1
| | | | | | | | | | | | | | | | | | | Problem: When ipv6 pim configuration is removed from the IIF on FHR node, if we wait for RST timer to expire and then add the ipv6 pim configuration on the IIF again, it is seen that pimreg is not getting added due to which null register wont be sent, the register flag state also remains NO_INFO forever instead of RegPrune. The reason for this is, when RST timer expires and IIF is unknown for the (S,G) upstream, the FHR state is not reset due to which when the RP becomes reachable, upstream state changes from NotJoined to Join but the register suppress timer could not be started since we see there is no change in FHR state. Fix: When the Register Timer expires and the reg state is set to PIM_REG_NOINFO,reset the FHR flag, so that when the RP becomes reachable can be because of config change or RP not reachable, it is able to resume its duty. Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
* pimd: adjust the display for debuganlan_cs2023-06-081-2/+2
| | | | | | | | | | | | | | | | | | | The vrf name should be separated when it is displayed. And remove unnecessary space after number. Before: ``` pim_upstream_sg_running: (100.100.1.100,232.100.100.100)x is not installed in mroute pim_upstream_del(pim_ifchannel_delete): Delete (100.100.1.100,232.100.100.100)[x] ref count: 1 , flags: 1048585 c_oil ref count 2 (Pre decrement) ``` After: ``` pim_upstream_sg_running: (100.100.1.100,232.100.100.100)[x] is not installed in mroute pim_upstream_del(pim_ifchannel_delete): Delete (100.100.1.100,232.100.100.100)[x] ref count: 1, flags: 1048585 c_oil ref count 2 (Pre decrement) ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
* *: Convert event.h to frrevent.hDonald Sharp2023-03-241-1/+1
| | | | | | | We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp2023-03-241-16/+16
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-10/+10
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Rename `struct thread` to `struct event`Donald Sharp2023-03-241-4/+4
| | | | | | | | | 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>
* *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-241-1/+1
| | | | | | | | | | | 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>
* pimd, pim6d: Fix join prune handlingSarita Patra2023-02-241-4/+6
| | | | | | | | | | | When upstream RPF address is secondary address, and neighborship is built with primary address, then pim_neighbor_find() fails. Verify the upstream RPF address is present in the neighbor primary and secondary address list. Signed-off-by: Sarita Patra <saritap@vmware.com>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: consistently ignore prefix list mask lenDavid Lamparter2022-11-041-1/+1
| | | | | | | | ... the prefix length wasn't ignored as expected. Both S and G are always /32. But expecting "le 32" in prefix-list config is unexpected & counterintuitive. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: Remove pim_br vestigesDonald Sharp2022-10-271-2/+1
| | | | | | | | | | If PIM had received a register packet with the Border Router bit set, pimd would have crashed. Since I wrote this code in 2015 and really have pretty much no memory of this and no-one has ever reported this crash, let's just remove this code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pimd: pim_upstream_add up must existDonald Sharp2022-08-151-9/+7
| | | | | | | | When calling pim_upstream_add, the lookup for upstream or the creation of the upstream cannot fail. As such up is never NULL. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #11536 from mobash-rasool/temp1Jafar Al-Gharaibeh2022-07-141-1/+10
|\ | | | | pimd: During prune pending, behave as NOINFO state (conformance issue)
| * pimd: During prune pending, behave as NOINFO stateMobashshera Rasool2022-07-061-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed ANVL Conformance PIM-SM 16.3 test case. When (S,G,rpt) prune is received, we were installing the mroute immediately with none as OIF. This leads to dropping the (S,G) traffic during prune pending time as well. Also we should not install the mroute if there is no change in the rpf update. These 2 things lead to the failure of the test case. Fixed it by blocking the installation in this scenario. When prune pending timer pops, it will take care of installing the mroute with none as OIF. Fixes: #11535 Signed-off-by: Mobashshera Rasool <mrasool@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 pim_upstreamsarita patra2022-07-061-43/+26
|/ | | | | | | In this PR, we are handling the pim_upstream after rpf_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
* pimd: Avoid reading freed memory.Mobashshera Rasool2022-06-241-2/+2
| | | | | | | | | | | | If the upstream is freed in pim_upstream_del, then trying to call pim_upstream_timers_stop will lead to accessing freed memory. Fix: Stop the timer only if upstream is not deleted. Co-authored-by: Sarita Patra <saritap@vmware.com> Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* Merge pull request #10712 from patrasar/pim_nexthop_prefix_to_pimaddrDavid Lamparter2022-04-261-4/+2
|\
| * pim6d: Handle mrib_nexthop_addr in pim_upstreamsarita patra2022-04-071-4/+2
| | | | | | | | Signed-off-by: sarita patra <saritap@vmware.com>
* | Merge pull request #10853 from plsaranya/pim_assert_fixesDonald Sharp2022-04-201-0/+1
|\ \ | | | | | | pimd: assert fixes
| * | pimd: Assert fixesplsaranya2022-03-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: PIM assert is not triggered even after receiving WRONGVIF notification because of Could_assert flag not set. CouldAssert(S,G,I) = SPTbit(S,G)==TRUE AND (RPF_interface(S) != I) AND (I in ( ( joins(*,G) (-) prunes(S,G,rpt) ) (+) ( pim_include(*,G) (-) pim_exclude(S,G) ) (-) lost_assert(*,G) (+) joins(S,G) (+) pim_include(S,G) ) ) Once SPTbit is set, Could_assert has to be reevaluated Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
* | | pimd: Changing PIM_OIF_FLAG_PROTO_IGMP to PIM_OIF_FLAG_PROTO_GMAbhishek N R2022-04-131-6/+5
| |/ |/| | | | | | | | | Modified marco name so that it can be reused in mld. Signed-off-by: Abhishek N R <abnr@vmware.com>
* | pimd, zebra: Fix spelling of fowardingDonald Sharp2022-04-021-1/+1
|/ | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #10583 from donaldsharp/pim_upstream_timersDonatas Abraitis2022-03-151-3/+10
|\ | | | | pimd: Ensure timers are stopped on instance shutdown
| * pimd: Ensure timers are stopped on instance shutdownDonald Sharp2022-02-171-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pim_upstream data structure has a ref count that is not properly being incremented/decremented and when an instance is removed this is causing crashes because timers are still popping afterwords on data structures that are now freed. Since getting the ref count code is extremely hard and we know that this crash is happening, add a bit of code to prevent the timers from popping at all when we go through and free up other data structures that we are pointing at. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | pim6d: Handling IPV6 in pim_upstreamsarita patra2022-02-281-15/+14
| | | | | | | | Signed-off-by: sarita patra <saritap@vmware.com>
* | Merge pull request #10400 from opensourcerouting/pim6-compilefixDonald Sharp2022-02-261-10/+10
|\ \ | | | | | | pim6d: get running with ipv6 types throughout
| * | pim6d: IPv6-adjust mroute codeDavid Lamparter2022-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is just hitting the pim_mroute code with a hammer until it doesn't print warnings anymore. This is NOT quite tested or working yet, it just compiles. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * | pim6d: IPv6-adjust upstream_rpf_genid_changedDavid Lamparter2022-02-161-9/+9
| |/ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* / *: Change thread->func to return void instead of intDonald Sharp2022-02-241-16/+11
|/ | | | | | | 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_upstream addrDavid Lamparter2022-02-141-7/+5
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: IPv6-adjust neigh->source_addrDavid Lamparter2022-02-141-13/+11
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pim6d: IPv6-adjust various pim_sgaddr usesDavid Lamparter2022-02-141-5/+2
| | | | | | | 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>
* pimd: add PIMADDR_ANY & tackle assignmentsDavid Lamparter2022-01-171-1/+1
| | | | | | | Need a separate constant that is IPv6 when needed. Also assign the whole struct rather than just s_addr. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: deploy pim_sgaddr_* helpersDavid Lamparter2022-01-171-19/+3
| | | | | | | Use _cmp/_hash/_match helpers for operations on pim_sgaddr to prepare IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: move & deploy pim_addr_cmp() helperDavid Lamparter2022-01-171-2/+1
| | | | | | Comparing `s_addr` isn't cutting it for IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: move, rename and deploy pim_addr_is_any()David Lamparter2022-01-171-19/+17
| | | | | | | | | 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>
* pimd: remove pim_str_sg_dump()David Lamparter2022-01-171-2/+2
| | | | | | | | ... 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>
* pimd: remove pim_str_sg_set()David Lamparter2022-01-171-1/+1
| | | | | | ... and replace with `%pSG` printfrr specifier. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* pimd: `prefix_sg` => `pim_sgaddr`David Lamparter2022-01-121-10/+8
| | | | | | | | | | | 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>
* Merge pull request #9906 from patrasar/2553196Donald Sharp2021-11-241-3/+2
|\ | | | | pimd: During Joined -> NotJoined, upstream should send prune nomatter
| * pimd: During Joined -> NotJoined, upstream should send prune nomattersarita patra2021-11-241-3/+2
| | | | | | | | | | | | | | | | | | RCA: When upstream transition from Joined to NotJoined due to SGRpt prune, then only SGRpt prune was sent and SG Prune is missed. Fix: Send SG Prune towards source as well as SGRpt prune towards RP. Signed-off-by: sarita patra <saritap@vmware.com>
* | Merge pull request #9919 from mobash-rasool/pim-upst-3Donald Sharp2021-11-221-0/+2
|\ \ | | | | | | pimd: STAR inherited Flag not properly set in certain scenarios
| * | pimd: STAR inherited Flag not properly set in certain scenariosMobashshera Rasool2021-10-291-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem Statement: ================== Mroutes are not recovered after shut/no shut of DUT to RP links One interface is not added in OIL List in intermediate router, hence traffic never received at LHR and mroutes not created for (S,G). Root Cause Analysis: ==================== Generally (*,G) PIM Join is received first and then (S,G) joins are received. This issue occurs when (S,G) join comes first and then the (*,G) Join. When (S,G) PIM Join is received, ifchannel is created and channel_oil OIF flag is set to PIM_OIF_FLAG_PROTO_PIM. Now when (*,G) join is received the flag PIM_OIF_FLAG_PROTO_STAR is not inherited due to wrong check present in function pim_upstream_inherited_olist_decide. Fix: =================== When (*,G) PIM Join is received, it should always add PIM_OIF_FLAG_PROTO_STAR flag for all the (S,G) channel oils no matter what order the (*,G) or (S,G) is received. Fixes: #9918 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* | pimd: remove some constant parametersDavid Lamparter2021-11-171-1/+1
| | | | | | | | | | | | ch_del is always true for all callers of ifjoin_to_noinfo. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pimd: clean up BSR NHT & fix parallel linksDavid Lamparter2021-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | pimd: Remove default from enum based switchDonald Sharp2021-11-101-3/+1
|/ | | | | | | | enum based switches should never use default. It makes it very hard to fix and find issues when the enum is changed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>