summaryrefslogtreecommitdiff
path: root/pimd/pim_ifchannel.c
AgeCommit message (Collapse)Author
2025-02-06pimd: Fix for FHR mroute taking longer to age outRajesh Varatharaj
Issue: When there is no traffic for a group, the LHR and RP take the default KAT+Join timer expiry of a maximum of 480 seconds to clear the S,G . However, in the FHR, we update the state from JOINED to NOT Joined, downstream state from PPto NOINFO. This restarts the ET timer, causing S,G on FHR to take more than 10 minutes to age out. In other words, Consider a case where (S,G) is in Join state. When the traffic stops and the KAT (210) expires, the Join expiry timer restarts. At this time, if we receive a prune, the expectation is to set PPT to 0 (RFC 4601 sec 4.5.2). When the PPT expires, we move to the noinfo state and restart the expiry timer one more time. We remove the (S,G) entry only after ~10 minutes when there is no active traffic. Summary: KAT Join ET 210 + PP ET 210 + NOINFO ET 210. Solution: Delete the ifchannel when in noinfo state, and KAT is not running. Ticket: #13703 Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
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-05-08pimd: fix order of operations for evaluating joinDavid Lamparter
join_desired looks at whether up->channel_oil is empty. up->channel_oil is updated from pim_forward_stop(), calling pim_channel_del_oif(). But that was being called *after* updating join_desired, so join_desired saw a non-empty OIL. Pull up the pim_forward_stop() call to before updating join_desired. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-06-07pimd: Fix wrong protocol for SSManlan_cs
Consider LHR in `SSM` case, and its `oif` goes from up to down. As the `oif` changes down, the `channel_oil` is still wrongly reserved with `PIM_OIF_FLAG_PROTO_STAR` protocol. The mechanism of adding `STAR` protocol for <S,G> entry without `oif` is introduced by commit `2164ed5`, which should be only used for ASM. PR #13699 wants to clean this `STAR` protocol after the `oif` becomes up again. That case is for SSM, as the `oif` changes down, the `channel_oil` should be removed, so the fix of that PR is wrong. In `pim_ifchannel_delete()` we should check the `ch->parent` before that mechanism of adding `STAR` protocol. If `ch->parent` is NULL, we should skip that mechanism with SSM. Fixes #13696 Signed-off-by: anlan_cs <vic.lan@pica8.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 THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp
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-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-12-15pimd: Handling SGRPT prune receivedSarita Patra
Topology: ======== Receiver----R1----(ens192)R2(ens224)----R3----R4----Source -------------------------- R1=LHR R2=RP R4=FHR Problem: ======= 1. Direct connected link between R1 and R3 is down initially. 2. So traffic flow path is R4<->R3<->R2<->R1<->Receiver. 3. Mroutes are properly created on all the nodes. 4. Up the direct connected link between R1 and R3. 5. Traffic flows in both the paths. R4<->R3<->R2<->R1<->Receiver R4<->R3<->R1<->Receiver 6. Duplicate traffic received at the receiver. Root Cause: ========== Initially when the direct connected link between R1 and R3 is down, traffic flows via RP(R2). So in RP (S,G) installed with IIF as ens224 and OIF as ens192 (reference = 2) with mask PIM_OIF_FLAG_PROTO_STAR and PIM_OIF_FLAG_PROTO_PIM. Now when the direct link between R1 and R3 is Up, LHR(R1) sends SGRPT prune. After prune received, RP(R2) will remove OIF ens224 with mask PIM_OIF_FLAG_PROTO_STAR. Since OIF ens224 is still present with mask PIM_OIF_FLAG_PROTO_PIM, RP(R2) will not send prune towards R3. So traffic continues to flow in the path R4<->R3<->R2<->R1<->Receiver. Fix: ==== When SGRpt prune received, remove OIF irrespective of the OIF is installed with mask "PIM_OIF_FLAG_PROTO_STAR" or "PIM_OIF_FLAG_PROTO_PIM". Once OIF is removed, RP sends prune towards R3. Issue: #11347 Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-11-04pimd: consistently ignore prefix list mask lenDavid Lamparter
... 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>
2022-08-15pimd: ch->upstream cannot be NULLDonald Sharp
in pim_ifchannel.c there exists several spots where the ch->upstream is assumed to be NULL. This is not possible. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-06pimd: Handle rpf_addr in pim_ifchannel codesarita patra
Signed-off-by: sarita patra <saritap@vmware.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-04-13pimd: Changing PIM_OIF_FLAG_PROTO_IGMP to PIM_OIF_FLAG_PROTO_GMAbhishek N R
Modified marco name so that it can be reused in mld. Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-04pimd: remove useless PIM_IF_* macrosDavid Lamparter
The only function these macros have is to make the code confusing. "PIM_IF_DO_PIM" sounds like it triggers some action, but it doesn't. Replace with "bool" fields in struct pim_interface. (Note: PIM_IF_*_IGMP_LISTEN_ALLROUTERS was always set, without any way to unset it. It is completely removed now and always enabled.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11pim6d: fix some format strings for IPv6David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28pim6d: Handling IPV6 in pim_upstreamsarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-26Merge pull request #10400 from opensourcerouting/pim6-compilefixDonald Sharp
pim6d: get running with ipv6 types throughout
2022-02-24Merge pull request #10632 from donaldsharp/thread_return_nullChristian Hopps
*: Change thread->func to return void instead of int
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-21pimd: cosmetic changeanlan_cs
Remove one empty line. And correct one word. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-16pim6d: IPv6-adjust mroute codeDavid Lamparter
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>
2022-02-14pim6d: IPv6-adjust pim_ifchannel_*David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14pim6d: IPv6-adjust assert-related addrsDavid 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: IPv6-adjust various pim_sgaddr usesDavid Lamparter
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>
2022-01-17pimd: replace pim_inet4_dump with `%pPAs`David Lamparter
Only pim_sgaddr uses are covered by this since regular in_addr is still used for singular addresses, so only a part of pim_inet4_dump calls are gone with this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: add PIMADDR_ANY & tackle assignmentsDavid Lamparter
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>
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-25pimd: removing no caller functionsSai Gomathi
Removing the no caller function declarations and definitions in pimd directory. Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-11-17pimd: fix event order for forward_stop()David Lamparter
`pim_ifchannel_ifjoin_switch()` changes flags that `pim_forward_stop()` looks at. This leads to data flow continuing until we have some reason to sync state again. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17pimd: remove some constant parametersDavid Lamparter
ch_del is always true for all callers of ifjoin_to_noinfo. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-26Merge pull request #9083 from mobash-rasool/pim-upst-3Jafar Al-Gharaibeh
pimd: In Prune Pending state, the holdtime change is not taking effect
2021-07-19pimd: pim_ifchannel_local_membership_add should not inherit if (S,G) rpf ↵github login name
unresolved Problem: S,G entry has iif = oif in FHR is LHR case. Setup:- R11-----R2----R4 R11 :- FHR and LHR R2 :- RP R4 :- LHR Issue :- 1) shut mapped interface in R11 2) wait for 5 min 3) do FRR restart 5) No shut of mapped interface OIL is added for local interface also where OIL is same as IIF and duplicate traffic observed on R4 receives in Ixia RCA: pim_ifchannel_local_membership_add adds inherited oif from starg when iif for SG is unavailable. When rpf for that SG resolves to this inherited oif from starg, iif is also in oif. This results in dup traffic. Fix: If iif is not available, do not inherit from starg. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-19pimd: In Prune Pending state, the holdtime change is not taking effectgithub login name
Problem Statement: In Prune pending state, when Join is received, and there is hold timer change the Expiry timer is not getting updated with new Hold timer. Root Cause: When thread_add_timer function is called and the thread is already in the list the thread api just returns, it does not modify the timer value. So when we want to change the timer, we need to first call THREAD_OFF and then call thread_add_timer. The Expiry timer thread is not cancelled in PIM_IFJOIN_PRUNE_PENDING state, therefore the timer change is not taking effect. Fix: Call THREAD_OFF in that flow. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-01*: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLENDonatas Abraitis
Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-12pimd: Use __func__ instead of __PRETTY_FUNCTION__Donald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-23pimd: zassert => assertDavid Lamparter
No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-01-28pimd: SGRpt prune received during prune didn't override holdtimesaravanank
RCA: There were 2 problems. 1. SGRpt prune expiry didn't create S,G entry with none oil when no other interfaces were part of the oil. 2. When restarting the timer with new hold value, comparision was missing and old timer was not stopping. Fix: SGRpt Prune pending expiry will put SG entry with none oil if no other Signed-off-by: Saravanan K <saravanank@vmware.com> interfaces present. If present we will be deleting the inherited oif from oil. Deleting the oif in that scenario will take care of changing mroute. When alone interface expires in SGRpt prune pending state, we shall detect by checking installed flag. if not installed, install mroute.
2020-12-17pimd: when node changes from non-DR to DR S,G entry not createdMobashshera Rasool
1. When a node changes from non-DR to DR in the given topology, the node was receiving both PIM Join as well as IGMP join. Since it was already receiving PIM Join previously, ifchannel was already present. Hence when it becomes DR, the IGMP source flag is not set due to issue in the code. Hence it never creates S,G entry thinking that it is not DR. 2. When pim join expires, the pim flag is not reset when ifchannel is not deleted. Issue: #7752 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-11-02pimd: (*,G) Prune processing doesn't remove SGRpt ifchannelvdhingra
problem : ========= When (*,G) prune received where we have SGRpt state, ifchannel goes to NO_INFO state and doesn't get removed. Root cause : ============ During the processing of (*,G) prune, we are not removing the ifchannel on PruneTmp or PrunePendingTmp state. Fix : ===== In that scenario, stop joinExpiry timer and delete the ifchannel. issue #7347 Co-authored-by: Saravanan K <saravanank@vmware.com> Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-10-14Merge pull request #6016 from sarav511/ppendDonald Sharp
pimd: Handling prune received during join state and join received during prune pending