summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_nssa.c
AgeCommit message (Collapse)Author
2022-12-13Merge pull request #12191 from manojvn/463777Russ White
ospf6d: ospf6 route installation when changed from nssa to regular area.
2022-11-14ospf6d: ospf6 route installation when changed from nssa to regular area.Manoj Naragund
Problem: Delay in ospfv3 route installation when area gets converted to regular from NSSA. RCA: when area gets converted from NSSA to normal the type-7(NSSA_LSAs) gets flushed from the area, as a result the external routes learnt from these type-7s gets removed. Once the area is moved to nomral the type 5 lsas needs to flooded through the area so that routes are re-learnt. however there is a delay in flooding of these routes until these routes are refreshed. Due to this there is delay installation of these routes. Fix: The Fix involves refreshing of the type 5 lsas once the area is changed from nssa to regular area. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-20ospf6d: Clean up thread interfaceDonald Sharp
a) Remove setting of thread pointer to NULL after thread invocation, this is already done. b) Use thread_is_scheduled() Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-29Merge pull request #10158 from ckishimo/ospf6d_norefreshRuss White
ospf6d: stop refreshing type-5 from NSSA
2022-03-28ospf6d: fix NSSA area-range commandckishimo
When an area-range command is applied in an ABR, the more specific prefixes need to be removed. r2# sh ipv6 ospf database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 10.254.254.2 53 80000001 :: ASE 0.0.0.2 10.254.254.2 51 80000001 2001:db8:1::/64 ASE 0.0.0.3 10.254.254.2 51 80000001 2001:db8:3::/64 ASE 0.0.0.4 10.254.254.2 51 80000001 2001:db8:2::/64 ASE 0.0.0.5 10.254.254.2 46 80000001 2001:db8:1::/64 ASE 0.0.0.6 10.254.254.2 46 80000001 2001:db8:3::/64 ASE 0.0.0.7 10.254.254.2 46 80000001 2001:db8:2::/64 ASE 0.0.0.8 10.254.254.2 41 80000001 2001:db8:3::/64 ASE 0.0.0.9 10.254.254.2 41 80000001 2001:db8:1000::1/128 <-- ** ASE 0.0.0.10 10.254.254.2 41 80000001 2001:db8:1000::2/128 <-- ** ASE 0.0.0.12 10.254.254.2 24 80000001 2001:db8:1000::/64 ASE 0.0.0.1 10.254.254.3 52 80000001 2001:db8:2::/64 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
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-01-11ospf6d: add missing htonsckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-11ospf6d: fix typosckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-11ospf6d: use __func__ckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-10ospf6d: remove duplicated codeckishimo
The OSPF6_LSA_UNAPPROVED flag is set in the function above ospf6_lsa_translated_nssa_new, so there is no need to set the flag again Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-10ospf6d: remove double htonsckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-05ospf6d: stop refreshing type-5 from NSSAckishimo
With the current code, in a topology like this: r1 ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3(ASBR) NSSA where r3 is redistributing statics within the NSSA area, the ABR (r2) is translating type-7 lsa to type-5. Everytime the function ospf6_abr_nssa_task() is executed all translated type-5 are aged out and refreshed for no reason. So for instance having 3 lsas already advertised: r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 39 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 39 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 39 80000001 5:5::5/128 Adversting a new route from r3: r3(config)# ipv6 route 6:6::6/128 Null0 r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 124 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 124 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 124 80000001 5:5::5/128 ASE 0.0.0.4 2.2.2.2 8 80000001 6:6::6/128 That seems okay, however a few seconds later we see all prefixes refreshed r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 3600 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 3600 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 3600 80000001 5:5::5/128 ASE 0.0.0.4 2.2.2.2 3600 80000001 6:6::6/128 ASE 0.0.0.5 2.2.2.2 3 80000001 3:3::3/128 ASE 0.0.0.6 2.2.2.2 3 80000001 4:4::4/128 ASE 0.0.0.7 2.2.2.2 3 80000001 5:5::5/128 ASE 0.0.0.8 2.2.2.2 3 80000001 6:6::6/128 This PR prevents the LSA of being refreshed by unsetting the OSPF6_LSA_UNAPPROVED flag so advertising the last prefix will not refresh all of them: r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 90 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 47 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 35 80000001 5:5::5/128 ASE 0.0.0.4 2.2.2.2 7 80000001 6:6::6/128 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-10-28Merge pull request #9831 from manojvn/379909_383518Igor Ryzhov
ospf6d: minor code enhancements.
2021-10-26ospf6d: minor code enhancements.Manoj Naragund
Description: code changes involve removal of increment and decrement operators during function calls. These expressions make code less readable. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2021-10-19Merge pull request #9752 from opensourcerouting/ospf6d-nssa-rangesRuss White
ospf6d: add support for NSSA Type-7 address ranges
2021-10-08ospf6d: Do not explicitly set the thread pointer to NULLDonatas Abraitis
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>
2021-10-05ospf6d: add support for NSSA Type-7 address rangesRenato Westphal
Implement NSSA address ranges as specified by RFC 3101: NSSA border routers may be configured with Type-7 address ranges. Each Type-7 address range is defined as an [address,mask] pair. Many separate Type-7 networks may fall into a single Type-7 address range, just as a subnetted network is composed of many separate subnets. NSSA border routers may aggregate Type-7 routes by advertising a single Type-5 LSA for each Type-7 address range. The Type-5 LSA resulting from a Type-7 address range match will be distributed to all Type-5 capable areas. Syntax: area A.B.C.D nssa range X:X::X:X/M [<not-advertise|cost (0-16777215)>] Example: router ospf6 ospf6 router-id 1.1.1.1 area 1 nssa area 1 nssa range 2001:db8:1000::/64 area 1 nssa range 2001:db8:2000::/64 ! Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: fix lookup of translated Type-5 LSARenato Westphal
Type-7 LSAs and their corresponding Type-5 LSAs don't share the same LS IDs (unlike in the case of OSPFv2). As such, do not attempt to find a translated Type-5 LSA using the LS ID of a Type-7 LSA. Instead, use the LS-ID stored in the OSPF routing table. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: assorted code cleanupRenato Westphal
This commits consists of several changes that positively impact code reability without introducing any logical change. Summary of the changes: * Return earlier in ospf6_abr_range_update() in order to reduce one level of indentation; * Remove ospf6_translated_nssa_originate() since it's nothing other than a useless wrapper around ospf6_lsa_translated_nssa_new(); * Change ospf6_abr_translate_nssa() to return void; * Change ospf6_abr_process_nssa_translates() checking for NSSA areas before anything else; * Remove ospf6_abr_remove_unapproved_translates_apply() since it's a small function that is only called in one place; * Change ospf6_abr_check_translate_nssa() to avoid an LSDB lookup when the router isn't an ABR. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: remove unnecessary check when translating Type-7 LSARenato Westphal
In addition to being unnecessary, this check is problematic for the upcoming NSSA ranges feature since NSSA ranges aren't added to the OSPF routing table. Remove this for simplicity. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: fix memleak when translating NSSA LSARenato Westphal
Stop leaking 4096 bytes for each translated LSA. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: remove incomplete support for NSSA rangesRenato Westphal
This code tries to summarize NSSA Type-7 LSAs using normal ranges which are intended to summarize Type-3 LSAs only. This is not only wrong, but the code is incomplete and lacking lots of things. Better to remove it before implementing NSSA ranges correctly. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: fix processing of translated AS-external LSAsRenato Westphal
The iteration performed on ospf6_abr_unapprove_translates() was wrong since AS-external LSAs are stored in the global LSDB and not in the area LSDBs. As such, the "unapproved" flag wasn't being set in any translated AS-external LSA, leading them to linger forever. Fix the LSDB iteration and make the required changes to unset the "unapproved" flag for AS-external LSAs that shouldn't be removed. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: fix selection of NSSA forwarding addressRenato Westphal
Change ospf6_get_nssa_fwd_addr() to try finding a global address on any interface of the area and not on the first one only. Additionally, do a micro-optimization in ospf6_interface_get_global_address() to return as soon as a global address is found. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: remove unnecessary codeRenato Westphal
Every received or originated LSA is automatically scheduled to be refreshed periodically, there's no need to do that manually here. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05ospf6d: remove redundant loopRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-04ospf6d: Ensure expire thread is properly stoppedDonald Sharp
The lsa->expire thread is for keeping track of when we are expecting to expire(remove/delete) a lsa. There are situations where we just decide to straight up delete the lsa, but we are not ensuring that the lsa is not already setup for expiration. In that case just stop the expiry thread and do the deletion. Additionally there was a case where ospf6d was just dropping the fact that a thread was already scheduled for expiration. In that case we should just setup the timer again and it will reset it appropriately. Fixes: #9721 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-21ospf6d: implement Type-7 default routes for NSSA areasRenato Westphal
Add the "default-information-originate" option to the "area X nssa" command. That option allows the origination of Type-7 default routes on NSSA ABRs and ASBRs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21ospf6d: don't generate Type-7 LSA for route created by ↵Renato Westphal
"default-information-originate" The route created by the "default-information-originate" command isn't a regular external route. As such, an NSSA ABR shouldn't originate a corresponding Type-7 LSA for it (there's a separate configuration knob to generate Type-7 default routes). While here, fix a small issue in ospf6_asbr_redistribute_add() where routes created by "default-information-originate" were being displayed with an incorrect "unknown" type. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21ospf6d: fix metric type of NSSA Type-7 LSAsRenato Westphal
Fix wrong comparison since route->path.metric_type is always set to either 1 or 2. The OSPF6_PATH_TYPE_EXTERNAL2 constant, whose value is 4, refers to a route type so its usage was incorrect here. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24ospf6d: do not allow an area to be stub and NSSA at the same timeRenato Westphal
That should not be allowed under any circumstance. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24ospf6d: flush external LSAs when NSSA is configuredRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24ospf6d: fix flushing of all LSAs when NSSA is unconfiguredRenato Westphal
Once NSSA is unconfigured on an area, all self-originated Type-7 LSAs need to be flushed. The existing code was iterating over the LSDB in the wrong way, causing ospf6_nssa_flush_area() to flush LSAs of all types. Use the ALL_LSDB_TYPED_ADVRTR macro to perform the intended iteration correctly. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24ospf6d: don't delete area when NSSA is unconfiguredRenato Westphal
Once NSSA is unconfigured, the OSPF area should still be operational as a normal area instead of being deleted. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24ospf6d: always unset the E-bit on NSSA ABRsRenato Westphal
RFC 3101 - Section 2.1 says: "(..) Interfaces associated with an NSSA will not send or receive Type-5 LSAs on that interface but may send and receive Type-7 LSAs. Therefore, if the N-bit is set in the options field, the E-bit must be clear." If the E-bit isn't cleared on an NSSA ABR, that will cause hello packets to be dropped (due to parameters mismatch), which will prevent the ABR from forming adjacencies with others routers in the NSSA area. This problem didn't affect the existing NSSA topotest by chance of luck. In that topotest, in the NSSA ABR, the NSSA area is configured before any interface is associated to it. That caused ospf6_check_and_set_router_abr() to return false, leading to the unsetting of the E-bit. With this fix, the order in which areas/interfaces are configured shouldn't matter because the E-bit will always be unset on NSSA areas. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-07-30Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisationRuss White
Ospfv3 ASBR summarisation feature
2021-07-29Merge pull request #9193 from mobash-rasool/ospfv3-bug-fixesRuss White
ospf6d: Type-7 LSA originated with wrong sequence number
2021-07-27ospf6d: Type-7 LSA originated with wrong sequence numberMobashshera Rasool
RCA: When Type-7 LSA is updated, the LSDB is searched, if the LSA is present in the LSDB then the LSA is updated with next sequence number and if not then it is originated with the INITIAL sequence number. Here while originating Type-7 LSA Process Level LSDB is searched for instead of area level LSDB. Fix: Search in the area level LSDB and not in the process level. Fixes #9099 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-21ospf6d: install summary route NULL0 as nexthopMobashshera Rasool
This is a requirement for avoiding sending traffic somewhere it was not supposed to go: install summary route to local RIB to send traffic to Null0. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-21ospf6d: ASBR summarisation feature changes for NSSA areaMobashshera Rasool
1. ASBR summarisation for Type-7 LSAs are done here. 2. Fixed Code warnings Signed-off-by: Mobashshera Rasool<mrasool@vmware.com>
2021-07-20ospf6d: move prefix_options from _path to _routeDavid Lamparter
Prefix options are per-prefix, not per-path. As evident by the fact that the field is never used on ECMP paths. Move it where it belongs. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-06-23ospf6d: fix NSSA status updateIgor Ryzhov
We should update ASBR status only when the NSSA status is actually changed. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-10ospf6d: Rename ospf6_is_router_abr to more accurately reflect what it doesDonald Sharp
The ospf6_is_router_abr is checking to see if ospfv3 is an abr router and also setting values. Let's rename it too `ospf6_check_and_set_router_abr` to more accurately reflect what it is doing. Additionally fix coverity #1505176 where we were not checking the return value of ospf6_is_router_abr like we did every other time. In this case we don't care about the return value so indicate that we do not. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-04ospf6d: Support for nssa in ospfv3Kaushik
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>