summaryrefslogtreecommitdiff
path: root/pimd/pim_rpf.c
AgeCommit message (Collapse)Author
2022-11-09pimd: Convert zlog_warn to debugDonald Sharp
The unable to find a nexthop should not be a warning it should be a debug. Switching over. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 7d7206a534eec49b83ff0ef95fe1ba04e5507fc8)
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 rpf codesarita patra
In this PR, we are handling the pim_rpf code after rpf_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-06-23pimd: Limit pim's ecmp to what zebra tells us is the multipathDonald Sharp
Zebra can be setup to use a value that is less than MULTIPATH_NUM. When pimd connects to zebra, zebra will inform pim about the MULTIPATH_NUM used. Let's use that value for figuring out our multipath value. 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-04-06pim6d: Adjust mrib_nexthop_addr rpf codesarita patra
In this PR, we are handling the pim_rpf code after mrib_nexthop_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-08pim6d: Modify apis in pim_rpf.c for PIMv4/PIMv6Mobashshera Rasool
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-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-03-01pim6d: Handling pim_rpf for IPV6sarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28pim6d: Handling last_lookup in pim_nexthop for IPV6sarita patra
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-16pim6d: IPv6-adjust RPF lookupsDavid 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: 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: 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>
2021-11-17pimd: clean up BSR NHT & fix parallel linksDavid Lamparter
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>
2021-09-16Merge pull request #9489 from opensourcerouting/pim-restruct-20210825Donald Sharp
pimd: move IGMP memberships from socket to iface, + some cleanups
2021-08-27pimd: de-circularize includesDavid Lamparter
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>
2021-08-24pimd: Fixing coverity issuesSai Gomathi
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-05-12pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp
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>
2020-08-05pimd: crash fix when RP is removedMobashshera Rasool
pimd crash at pim_msg_build_jp_groups ( grp=grp@entry=0x7ffca55b5d1e, sgs=sgs@entry=0x17821a0, size=20) at pimd/pim_msg.c:198 Fix for https://github.com/FRRouting/frr/issues/6849 Root Cause: =========== pimd has crashed because pim_upstream_rpf_clear function sets the up->rpf.source_nexthop.interface pointer to NULL and has not removed the upstream source node from the neighbor. When the upstream gets deleted the source is not removed from neighbor neigh->upstream_jp_agg->groups->sources list. This source node has pointer to upstream freed memory. Hence when on_neighbor_jp_timer expires, it tries to access the upstream pointer and crashed. Fix: ==== Before setting the interface pointer to NULL, remove the node from neigh->upstream_jp_agg->groups->sources list. Also the upstream state has to be changed to Not joined. Removed extra line changes. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-07-14*: remove PRI[udx](8|16|32)David Lamparter
These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-14pimd: increase RPF metric via the peerlink_rif by plus-10Anuradha Karuppiah
The RPF cost is incremented by 10 if the RPF interface is the peerlink-rif. This is used to force the MLAG switch with the lowest cost to the RPF to become the MLAG DF. If a switch has to go via the peerlink-rif to get to the RP or source it simplly cannot be the designated forwarder. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14pim: DF election for tunnel termination mroutes in an anycast-VTEP setupAnuradha Karuppiah
1. Upstream entries associated with tunnel termination mroutes are synced to the MLAG peer via the local MLAG daemon. 2. These entries are installed in the peer switch (via an upstream ref flag). 3. DF (Designated Forwarder) election is run per-upstream entry by both the MLAG switches - a. The switch with the lowest RPF cost is the DF winner b. If both switches have the same RPF cost the MLAG role is used as a tie breaker with the MLAG primary becoming the DF winner. 4. The DF winner terminates the multicast traffic by adding the tunnel termination device to the OIL. The non-DF suppresses the termination device from the OIL. Note: Before the PIM-MLAG interface was available hidden config was used to test the EVPN-PIM functionality with MLAG. I have removed the code to persist that config to avoid confusion. The hidden commands are still available. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-13*: Remove break after returnDonatas Abraitis
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-15pimd: RPF change to unreachable was leaving a stale entry in the jp-agg listAnuradha Karuppiah
This was causing pimd to crash later; call-stack - (gdb) bt context=<optimized out>) at lib/sigevent.c:254 group=group@entry=0x7ffffa9797e0) at pimd/pim_rp.c:207 grp=grp@entry=0x7ffffa9799fe, sgs=sgs@entry=0x560ac069edb0, size=52) at pimd/pim_msg.c:200 groups=<optimized out>) at pimd/pim_join.c:562 at pimd/pim_neighbor.c:288 at lib/thread.c:1599 at lib/libfrr.c:1024 envp=<optimized out>) at pimd/pim_main.c:162 (gdb) fr 4 group=group@entry=0x7ffffa9797e0) at pimd/pim_rp.c:207 207 pimd/pim_rp.c: No such file or directory. (gdb) fr 6 grp=grp@entry=0x7ffffa9799fe, sgs=sgs@entry=0x560ac069edb0, size=52) at pimd/pim_msg.c:200 200 pimd/pim_msg.c: No such file or directory. (gdb) p source->up->sg_str $1 = '\000' <repeats 31 times>, <incomplete sequence \361> (gdb) This problem can manifest in the following event sequence - 1. upstream RPF neighbor is resolved 2. upstream RPF neighbor becomes unresolved (but upstream entry stays on the jp-agg list) 3. upstream entry is removed on the next old-neighbor jp-agg-list processing the stale entry is accessed resulting in the crash. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: add caller string prefix to pim_rpf_update logsAnuradha Karuppiah
No functional change; log enhancements only. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: we cannot change the Joined state based on RPF resolutionAnuradha Karuppiah
Joined state is computed based on the downstream state and cannot be changed if the RPF link flaps. Reference: rfc 7761, section 4.5.5 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: set mfcc_parent at the time of MFCC programmingAnuradha Karuppiah
mfcc_parent for an (S, G) entry was being updated on any upstream RPF change. With the change to use RPT for (S,G) in some cases we can no longer do that. Instead the upstream entry's RPF neigbor is managed separately form the channel_oil's mfcc_parent i.e. via NHT. And the mfcc_parent is evaluated at the time of mroute programming. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-12pimd: `debug igmp trace` turns on non igmp debugsDonald Sharp
When you turn on `debug igmp trace` we are seeing a bunch of debugs associated with pim processing. This is because we were using PIM_DEBUG_TRACE which is both `debug igmp trace` and `debug pim trace` when tracing igmp code it would be nice to only see igmp work. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-18pimd: Add pim_channel_oil_change_iifDonald Sharp
Add a function that allows you to modify the channel oil's incoming interface and to appropriately install/remove it from the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-01*: s/TRUE/true/, s/FALSE/false/Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-07pimd: Remove unnecessary boolean to pim_rpf_updateDonald Sharp
We already log whether or not we add nht tracking, having an additional boolean to say to log another line is a bit over the top. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-28Merge pull request #4239 from sarav511/rpJafar Al-Gharaibeh
pimd: PIM Bootstrap Message Processing
2019-05-14pimd: PIM nexthop tracking changes for tracking nexthop path of BSR.saravanank
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14lib: hashing functions should take const argumentsQuentin Young
It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-20 pimd: provide a mechanism to pin the IIF for an SG entryAnuradha Karuppiah
In the case of vxlan origination entries IIF is set to - 1. lo for single VTEPs 2. MLAG-ISL for VTEPs multihomed via MLAG. This commit creates the necessary infrastructure by - 1. allowing the IIF to be set statically (without RPF lookup) 2. and by preventing next-hop-tracking registration PS: Note that I have skipped additional checks in pim_upstream_del intentionally i.e. an attempt will be made to remove nexthop-tracking for the upstream entry (with STATIC_IIF) which will fail because of the up-entry not being in the nh's hash table. Ideally we should maintain a nh pointer in the up-entry to prevent this unnecessary processing. In the abscence of that I wanted to avoid spraying STATIC_IIF checks all over. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-05pimd: Tracking of RPF is *separate* from the lookupDonald Sharp
Start the separation of tracking a Destination from the act of looking it up. The cojoining of these two concepts led to a bunch of code that had to think about both problems leading to weird situations and code paths. Simplify the code by making pim_ecmp_nexthop_search a static function and we only ever call pim_ecmp_nexthop_lookup when we need to do a RPF(). pim_ecmp_nexthop_lookup will now attempt to find a stored pnc and if it finds one it will report on the answer from it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-02pimd: pim_nexthop_lookup should return true/falseDonald Sharp
The current reverse logic led to this code construct if (!pim_nexthop_lookup(...)) { //Do something successfull } This is backwards and will cause logic errors when people use this code. Fix to use true/false for success/failure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-18pimd: Addressing the review commentsSarita Patra
Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-24pimd: clear upstream rpf information when RP becomes not reachableSarita Patra
When route to RP gets modified, FRR receives a notification from zebra, and call the function pim_resolve_upstream_nh() to compute the nexthop and update upstream->rpf structure. Issue: In case when RP becomes not reachable, FRR only uninstall the mroute from the kernal, but not update the upstream->rpf structure. Fix: When FRR receives a notification from zebra saying RP becomes not reachable, then update the following fields. 1. update channel_oil incoming interface as MAXVIFS 2. Un-install the mroute from the kernel. 3. Switch upstream state from JOINED to NOTJOINED. 4. Clear the nexthop information of the upstream. Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-24pimd: Handling Null incoming interface of dummy upstreamSarita Patra
When FRR receives IGMP/PIM (*, G) join and RP is not configured or not reachable, then we are creating a dummy upstream with incoming interface as NULL and upstream address as INADDR_ANY. Added upstream address and incoming interface validation where it is necessary, before doing any operation on the upstream. Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-10-19*: Replace hash_cmp function return value to a boolDonald Sharp
The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-07pimd: Remove duplicate parameter to functionsDonald Sharp
Both pim_ecmp_nexthop_lookup and pim_ecmp_fib_lookup_if_vif_index pass the address in 2 times. Make function calls consistent and just pass in the src once. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-07pimd: There is no reason a IGMP src should need a neighborDonald Sharp
There is no reason that a IGMP src should need a upstream pim neighbor when doing a RPF lookup. Ticket: CM-21599 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-05Merge pull request #2371 from gromit1811/pim-rp-lookup-messages-fixDonald Sharp
pimd: Fix debug messages
2018-06-05pimd: Comment spelling fixMartin Buck
Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2018-06-04pimd: Fix debug messagesMartin Buck
Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>