summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_flood.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospf6d: Check for MinLSInterval timer when adding to LSUpdate listYash Ranjan2022-04-181-15/+28
| | | | | | | | | | | | | | | | | | | | | A router has some static routes and redistributes turned on. "clear ipv6 ospf process" command is applied. Then static routes are deleted. In 1 in 5 runs, AS-External LSAs are not getting removed from the neighbors even though it gets removed from its own LSDB. Because of the clear process command, MAX_AGE LSAs are advertised and fresh LSAs are installed in the LSDB. When the MAX_LSAs are advertised back to the same router as part of the flooding process, it gets added to the LSUpdate list even though it comes inside the MinLSArrival time. When the static routes get deleted, it removed the LSA from the LSRetrans list but not from LSUpdate list. The LSAs present in the LSUpdate list gets advertised when sending LS Updates. When an old copy of an LSA is more recent than the new LSA, check if it has come inside the MinLSArrival time before adding to the LSUpdate list. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* ospf6d: crash in ospf6_decrement_retrans_count.Manoj Naragund2022-03-171-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ospf6d crash is observed when lsack is received from the neighbour for AS External LSA. RCA: The crash is observed in ospf6_decrement_retrans_count while decrementing retransmit counter for the LSA when lsack is recived. This is because in ospf6_flood_interace when new LSA is being added to the neighbour's list the incrementing is happening on the received LSA instead of the already present LSA in scope DB which is already carrying counters. when this new LSA replaces the old one, the already present counters are not copied on the new LSA this creates counter mismatch which results in a crash when lsack is recevied due to counter going to negative. Fix: The fix involves following changes. 1. In ospf6_flood_interace when LSA is being added to retrans list check if there is alreday lsa in the scoped db and increment the counter on that if present. 2. In ospf6_lsdb_add copy the retrans counter from old to new lsa when its being replaced. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
* ospf6d: Remove ospf6->external_id_tableDonald Sharp2021-11-241-20/+0
| | | | | | | | | | | | | | | The external_id_table was only ever used to store pointers to data and was never used for lookup during the course of normal operations. However it did lead to crashes because somewhere along the way external routes stored in the external_table never had their id associated into the external_id_table and we would assert on the node lookup failing. Since this code was never used for anything other than storing data and it was never retrieved for anything useful let's just remove it from ospf6d. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #9752 from opensourcerouting/ospf6d-nssa-rangesRuss White2021-10-201-9/+7
|\ | | | | ospf6d: add support for NSSA Type-7 address ranges
| * ospf6d: be careful to not refresh translated Type-5 LSAs twiceRenato Westphal2021-10-061-9/+7
| | | | | | | | | | | | | | | | | | The ABR task already takes care of refreshing translated Type-5 LSAs that correspond to self-originated Type-7 LSAs. There's no need to do that in ospf_external_lsa_install() as well. The ospfd NSSA code takes the same precaution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #9699 from manojvn/379032-devRuss White2021-10-071-1/+0
|\ \ | | | | | | ospf6d: minor struct compare issues.
| * | ospf6d: code cleanup.Manoj Naragund2021-10-061-1/+0
| | | | | | | | | | | | | | | | | | removal of some of the deadcode in ospf6d. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
* | | Merge pull request #9738 from rgirada/ospfv3_crashRuss White2021-10-071-7/+8
|\ \ \ | |_|/ |/| | ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.
| * | ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.rgirada2021-10-051-7/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: When grace lsa received, DUT is adding the copy of the lsas to all nbrs retransmission list as part of flooding procedure and subsequently incrementing the rmt counter in the original the LSA. This counter is supposed to be decremented when ack is received by nbr and the lsa will be removed from retransmission list. But in our current scenario, Step-1: When GR helper is disabled, if DUT receives the grace lsa it adds the lsa copy to nbrs retransmission list but original LSA will be discarded since GR helper disabled. Step-2: GR helper enabled and DUT receives the grace lsa, as part of flooding process all nbrs have same copy of lsa in their corresponding rmt list which was added in step -1 due to this the corresponding rmt counter in the original lsa is not getting incremented. Step-3: If the same copy of the grace lsa received by DUT, It considers as implicit ack from nbr if the same copy of the lsa exits in its rmt list and subsequently decrement the rmt counter. Since counter is zero (because of step-1 and 2) , it is asserting while decrement. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* / ospf6d: Do not explicitly set the thread pointer to NULLDonatas Abraitis2021-10-041-3/+0
|/ | | | | | | | FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* ospf6d: introduce support for Graceful Restart (restarting mode)Renato Westphal2021-09-161-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 5187 specifies the Graceful Restart enhancement to the OSPFv3 routing protocol. This commit implements support for the GR restarting mode. Here's a quick summary of how the GR restarting mode works: * GR can be enabled on a per-instance basis using the `graceful-restart [grace-period (1-1800)]` command; * To perform a graceful shutdown, the `graceful-restart prepare ipv6 ospf` EXEC-level command needs to be issued before restarting the ospf6d daemon (there's no specific requirement on how the daemon should be restarted); * `graceful-restart prepare ospf` will initiate the graceful restart for all GR-enabled instances by taking the following actions: o Flooding Grace-LSAs over all interfaces o Freezing the OSPF routes in the RIB o Saving the end of the grace period in non-volatile memory (a JSON file stored in `$frr_statedir`) * Once ospf6d is started again, it will follow the procedures described in RFC 3623 until it detects it's time to exit the graceful restart (either successfully or unsuccessfully). Testing done: * New topotest featuring a multi-area OSPF topology (including stub and NSSA areas); * Successful interop tests against IOS-XR routers acting as helpers. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #8935 from rgirada/ospfv3_gr_helperRenato Westphal2021-08-191-0/+61
|\ | | | | ospf6d: Support for ospfv3 graceful restart helper functionality
| * ospf6d: GR helper configurationsrgirada2021-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: Adding the following cli commands to enable/disable GR helper functionality. 1. [no] graceful-restart helper-only [A.B.C.D] 2. [no] graceful-restart helper lsa-check-disable 3. [no] graceful-restart helper planned-only 4. [no] graceful-restart helper supported-grace-time (10-1800) show commands: show ipv6 ospf6 graceful-restart helper [detail] [json] Signed-off-by: Rajesh Girada <rgirada@vmware.com>
| * ospf6d: GR helper exit scenariosrgirada2021-08-101-10/+46
| | | | | | | | | | | | | | | | | | | | | | Description: Changes to cover all the following GR helper exit scenarios. 1. Upon receiving max age grace lsa.( successful graceful restart) 2. Topo change 3. Grace timer expiry. 4. User changes( like config deletion , interface down) Signed-off-by: Rajesh Girada <rgirada@vmware.com>
| * ospf6d: Helper functionality changesrgirada2021-08-101-0/+25
| | | | | | | | | | | | | | | | | | Description: 1. changes to process GRACE LSA packet. 2. Validation changes to enter Helper role. 3. Helper functionality during graceful restart. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | ospf6d: Remove Type-7 LSA when Type-5 LSA is removedMobashshera Rasool2021-08-091-1/+18
|/ | | | | | | | Fix: When summarised Type-5 LSA is removed, the corresponding Type-7 LSAs also need to be removed from area. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisationRuss White2021-07-301-1/+26
|\ | | | | Ospfv3 ASBR summarisation feature
| * ospf6d: ASBR Summarisation feature implementationMobashshera Rasool2021-07-211-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Feature Implementation. ======================== This feature will help in advertising the External LSAs with aggregation. The commands allow us to tune the advertisement with different parameters as mentioned in the CLI List below. It can also help in case we do not want to advertise any prefix with the no-advertise option. New CLIs added: =============== summary-address X:X::X:X/M$prefix [tag (1-4294967295)] [{metric (0-16777215) | metric-type (1-2)}] no summary-address X:X::X:X/M$prefix [tag (1-4294967295)] [{metric (0-16777215) | metric-type (1-2)}] summary-address X:X::X:X/M$prefix no-advertise no summary-address X:X::X:X/M$prefix no-advertise aggregation timer (5-1800) no aggregation timer (5-1800) show ipv6 ospf6 summary-address [detail$detail] [json] debug ospf6 lsa aggregation CAT RUN: ======== QE to add test scripts Signed-Off-by: Mobashshera Rasool <mrassol@vmware.com>
* | ospf6d: don't create Adv-ID:0.0.0.0 LSAs at startDavid Lamparter2021-07-201-0/+10
|/ | | | | | | | | | | | | When ospf6d comes up, it gets interface and address state before it decides on its router ID. This results in a bunch of LSAs with advertising router ID 0.0.0.0 in the LSDB. Not quite right. There's a whole bunch of paths leading to this, so just drop the LSA in ospf6_lsa_originate. The router-ID change causes everything to be readvertised anyway (... but the delete doesn't catch the 0.0.0.0 stuff because the router-ID is now different.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: Max aged LSAs are not getting deleted from DBMobashshera Rasool2021-06-241-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | Problem Statement: ================== Max aged LSAs are not getting deleted from DB when there are multiple neighbors in a LAN. Root Cause Analysis: ==================== When the LSA is added to the neighbor's retransmit list, the LSA retrans count is incremented but it is not checked if the LSA is already present in the retransmit list leading to the count being incremented multiple times untill the ack is not received and when the ack is received the count is decremented once and hence the count never becomes 0 and it remains in the DB forever. Fix: ==================== Do not increment the retrans count multiple times if the LSA is already present in the retransmit list of the neighbor. Also do not add the LSA in the retransmit List if already present. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* Merge pull request #8841 from volta-networks/fix_ospf6_bad_seqnumDonald Sharp2021-06-191-0/+12
|\ | | | | ospf6: Drop LSA with bad seqnumber
| * ospf6: Drop LSA with bad seqnumberlynne2021-06-181-0/+12
| | | | | | | | | | | | | | | | In RFC 2328 seqnumber 0x80000000 is reserved and not used. If an LSA is received with seqnumber the LSA is now dropped and a debug error log is printed. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* | ospf6d: move error logs out from behind debug flagslynne2021-06-141-5/+6
|/ | | | | | | | | | The logging in ospf6 is very verbose. If you turn on logging on a scaled system you get too many logs. The problem is that there are some errors that occur that are hidden behind the debug flags, and to see these errors we currently need to turn on the debug logging. This change converts these error logs to warnings and removes the debug flags. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* ospf6d: Support for nssa in ospfv3Kaushik2021-06-041-4/+40
| | | | | | | | | | | | | The following is implemented. 1. Configuring area as NSSA. 2. Generating Type 7 LSA. 3. Conversion of Type 7 to Type 5 ( Default Behavior). 4. NSSA ABR selection. Reviewed-by: Rafael Zalamena <rzalamena@opensourcerouting.org> Co-authored-by: Kaushik <kaushiknath.null@gmail.com> Co-authored-by: Soman K.S <somanks@gmail.com> Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
* Merge pull request #8658 from gromit1811/bugfix_8567Martin Winter2021-05-131-8/+10
|\ | | | | Fix #8567 OSPFv3-26.13 ANVL failure
| * ospf6d: Send MAXAGE LS update for received old self-originated LSAsMartin Buck2021-05-111-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes OSPFv3-26.13 ANVL RFC conformance bug #8576 by improving the bugfix for #7030 from 4c63a76a. That commit changed handling of received old non-MAXAGE LSAs with a MAXAGE counterpart in the LSDB from "add all LSAs to LSDB and flood non-self-originated ones" to "add & flood only non-self-originated LSAs and ignore self-originated LSAs". The new behaviour is similar but adds sending a MAXAGE LS Update for received self-originated LSAs to remove the old LSAs from the network, resulting in "add & flood non-self-originated LSAs, don't add but send MAXAGE LS Update for self-originated LSAs". The missing MAXAGE LS Update is what OSPFv3-26.13 ANVL complained about. Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* | ospf6d: Fix when an "export-list" or "filter-list out" is applied.lynne2021-05-041-2/+4
|/ | | | | | | | | | | | | | | | | When an "export-filter" or "filter-list out" was configured on an area the filter was not applied to existing database. The user would either have to restart the neighboring router in the other area or issue a "clear ipv6 ospf6 interface" to cause the neighbor router to resend it's LSAs. The new filter would then be applied to these LSAs and permit or deny summary LSAs from being added/removed from the database. The code now applies the filters to the existing database without user needing to take any action to clear ospfv3 adjacencies. The second part of the problem was if a rule changed the updated filter was not applied. The code has been modifed to now process the rule update and reapply the filter. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* ospf6d: Do not flood unknown LSAs if U-bit is clearKaren Schoener2021-03-241-0/+13
| | | | | | Do not flood unknown LSAs if U-bit is clear. Signed-off-by: Karen Schoener <karen@voltanet.io>
* ospf6d: Remove #if 0 code that has not been used in a long timeDonald Sharp2021-01-281-12/+0
| | | | | | | The earliest that some of this code is 2018. There is not much point in keeping this code around. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* ospf6d : Transformation changes for ospf6 vrf support.harios_niral2020-10-311-1/+10
| | | | | | | | 1. All the changes are related to handle ospf6 with different vrf. 2. The dependancy of global ospf6 is removed. Co-authored-by: Kaushik <kaushik@niralnetworks.com> Signed-off-by: harios_niral <hari@niralnetworks.com>
* ospf6d: Fix flooding of old copies of self-originated LSAsMartin Buck2020-09-291-10/+14
| | | | | | | | | | | | | When receiving old copies (e.g. originated before the local ospf6d was restarted) of supposedly self-originated LSAs which we previously tried to flush from the network (by setting them to MaxAge), neither flood them nor add them to our LSDB. Instead, keep the MaxAge version until we actually (re-)originate them. Possible fix for #7030. Testcase in #7168 (tests/topotests/ospf6-dr-no-netlsa-bug7030). Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* ospf6d: Prevent use after freeDonald Sharp2020-04-181-4/+5
| | | | | | | | | | | ospf6_lsa_unlock may free the lsa data structure as such we cannot use the passed in data structure after freeing it. Provide a mechanism to know if the data has been freed using the same usage patterns of other _unlock functions in FRR. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp2020-03-061-1/+1
| | | | | | FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis2020-03-051-3/+3
| | | | | | Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* ospf6d: ospf6_flood.c: self-originated MaxAge LSAs to install and refresh.Yasuhiro Ohara2019-12-041-12/+0
| | | | Signed-off-by: Yasuhiro Ohara <yasu@nttv6.jp>
* Merge pull request #2814 from qlyoung/fix-ospf6d-lsa-uaf-testDavid Lamparter2018-08-201-0/+2
|\ | | | | ospf6d: fix use after free on LSA
| * ospf6d: sanity check refcount correctnessQuentin Young2018-08-141-0/+2
| | | | | | | | | | | | | | Coverity warns about a possible double free; add an assert to make sure we never hit it, and hopefully silence Coverity. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | ospf6d: revert fix for Coverity 1221459F. Aragon2018-08-131-1/+0
|/ | | | | | | | The correction in commit 7edb6aa (PR #2502) was wrong, as it is was not taking in consideration the unlock counter. Thanks to @eqvinox for noticing it. Signed-off-by: F. Aragon <paco@voltanet.io>
* spf6d: fix use after free (2) (Coverity 1221459)paco2018-06-211-0/+1
| | | | | | | | Previous fix was incomplete, as calling ospf6_lsa_unlock() frees 'req' but it does not put it to zero, so it was called ospf6_lsdb_remove() afterwards even being 'req' already freed. Signed-off-by: F. Aragon <paco@voltanet.io>
* spf6d: fix use after free (Coverity 1221459)paco2018-06-081-2/+3
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* ospf6d: Intra-prefix LSA update after frr restartChirag Shah2018-03-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Initially INP LSA is originated, when connected interface comes up. As neighbor is not up, LSA is not transmitted but stored in DB. As NSM transition to FULL, INP is scheduled but ospf6_flood() would not originate the LSA as current DB and new INP LSA same so it discards the new LSA. When Neighor becomes FULL, originate INP via flushing current DB copy and generate new. This is introduced as PR 1738 introduce, premature aging of LSAs in nbr table as R1 going down. upon neigbor coming up, INP was not updated to new age. Ticket:CM-19926,CM-19945 Testing Done: Topology R3 --- R1 -- R2, R1 have INP LSA. After frr restart R2 and R3 re learnt R1's INP LSA as new neighbor(s) come up. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-20/+19
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* ospf6d: Handle Premature Aging of LSAsChirag Shah2018-02-151-15/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 2328 (14.1) Premature aging of LSAs from routing domain : When ospf6d is going away (router going down), send MAXAGEd self originated LSAs to all neighbors in routing domain to trigger Premature aging to remove from resepective LSDBs. Neighbor Router Reboot: Upon receiving Self-originate MAXAGEd LSA, simply discard, Current copy could be non maxaged latest. For neighbor advertised LSA's (current copy in LSDB) is set to MAXAGE but received new LSA with Non-MAXAGE (with current age), discard the current MAXAGE LSA, Send latest copy of LSA to neighbors and update the LSDB with new LSA. When a neighbor transition to FULL, trigger AS-External LSAs update from external LSDB to new neighbor. Testing: R1 ---- DUT --- R5 | \ R2 R3 | R4 Area 1: R5 and DUT Area 0: DUT, R1, R2, R3 Area 2: R2 R4 Add IPv6 static routes at R5 Redistribute kernel routes at R5, Validate routes at R4, redistributed via backbone to area 2. Stop n start frr.service at R5 and validated MAXAGE LSAs then recent age LSAs in Database at DUT-R4. Validated external routes installed DUT to R4. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-882/+845
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: remove VTYNL, part 2 of 6David Lamparter2017-07-141-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: VNL -> VTYNLDavid Lamparter2017-07-141-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: update thread_add_* callsQuentin Young2017-05-091-42/+31
| | | | | | | | | | | | Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use monotime()David Lamparter2017-01-231-3/+3
| | | | | | This is largely a bulk-replace made with coccinelle. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>