summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_abr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: 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>
* *: 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>
* ospf6d: fix duplicate inter-area-prefix-LSAs after exiting from GR modeRenato Westphal2023-03-021-3/+13
| | | | | | | | | | An ABR that is originating inter-area-prefix-LSAs should take into account the fact that there might be self-originated LSAs for the same prefixes that were originated prior to a graceful restart. When that happens, the previous LSA-IDs should be reused to avoid having duplicate LSAs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospf6d: fix processing of inter-area-prefix-LSAs with the LA-bit setRenato Westphal2023-03-021-5/+4
| | | | | | | | | | | | | | | | RFC 5340, Section 4.8.3 says: "Prefixes having the NU-bit set in their PrefixOptions field should be ignored by the inter-area route calculation". Fix a bug where, in addition to the NU-bit, ospf6d was also ignoring prefixes having the LA-bit set when computing inter-area routes. In practice, this fixes interoperability issues with vendors that set the LA-bit in loopback prefixes (among other cases). While here, fix a copy-and-paste error where a log message wasn't showing accurate information about what happened. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: ospf6_route_cmp_nexthops make return saneDonald Sharp2022-11-281-1/+1
| | | | | | | | The ospf6_route_cmp_nexthops function was returning 0 for same and 1 for not same. Let's reverse the polarity and actually make the returns useful long term. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* ospf6d: Don't remove summary route if it is a rangeXiaodong Xu2022-08-201-1/+6
| | | | | | | | | | | | | | | | | | | | Fix issue #11839. When the user defines a range in an area other than the backbone area, the summary route will be announced to the backbone area as an inter-area LSA. However, if the prefix defined in the range is the same prefix as a connected route in that area, the LSA won't be announced to the backbone area. This is because when ospf6d is originating the summary route for the intra-area route, it finds the range configured by the user and tries to suppress the route by deleting the existing summary route, which happens to be the one created by the range. Although the range definition is not necessary in this case, it should not fail this use case. So let's just keep the summary route there if it is created from the user defined range. Signed-off-by: Xiaodong Xu <stid.smth@gmail.com>
* ospf6d: Fix ECMP inter-area route nexthop updateMartin Buck2022-01-201-1/+2
| | | | | | | | | | | | | | Fixes #9720. When updating an ECMP inter-area route, we compute a new route and check whether that already exists. If so, we keep the old route and only update its nexthops. Previously, we merged the new route's nexthops into the old one's, but this way, it's impossible to remove nexthops from the old route, resulting in stale nexthops. This commit fixes this by first removing all nexthops from the old route and then copying all nexthops from the new route into it. If the new route has fewer nexthops, the old one will have as well afterwards. Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* ospf6d: fix typosckishimo2022-01-111-1/+1
| | | | Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
* ospf6d: clean coverity warning of possible null pointeranlan_cs2021-12-231-0/+2
| | | | | | Add assert to protect it. Signed-off-by: anlan_cs <anlan_cs@tom.com>
* ospf6d: do not originate Type-4 into NSSAckishimo2021-11-161-1/+2
| | | | | | | | | | | | | In a topology like: r1(ASBR) ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3 where r1 is redistributing statics and area 1.1.1.1 is NSSA, the ABR r2 should not originate type-4 LSA into the NSSA area. From RFC 3101: "NSSA border routers should not originate Type-4 summary-LSAs into their NSSAs." This PR prevents the above LSA of being originated by the ABR r2 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
* ospf6d: do not originate Type-4 for NSSA ASBRckishimo2021-11-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | In a topology like: r1 ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3(ASBR) where r3 is redistributing statics and area 1.1.1.1 is NSSA, the ABR r2 should not originate type-4 LSA, according to RFC 3101, section 1.3: "also an NSSA's border routers never originate Type-4 summary-LSAs for the NSSA's AS boundary routers, since Type-7 AS-external-LSAs are never flooded beyond the NSSA's border" r1# sh ipv6 os database inter-router Area Scoped Link State Database (Area 0.0.0.0) Type LSId AdvRouter Age SeqNum Payload IAR 3.3.3.3 2.2.2.2 49 80000001 3.3.3.3 This PR prevents the above LSA of being originated by the ABR r2 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
* Merge pull request #9752 from opensourcerouting/ospf6d-nssa-rangesRuss White2021-10-201-41/+66
|\ | | | | ospf6d: add support for NSSA Type-7 address ranges
| * ospf6d: add support for NSSA Type-7 address rangesRenato Westphal2021-10-061-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ospf6d: assorted code cleanupRenato Westphal2021-10-061-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ospf6d: remove unused function parameterRenato Westphal2021-10-061-14/+9
| | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | ospf6d: code cleanup.Manoj Naragund2021-10-061-9/+8
| | | | | | | | | | | | removal of some of the deadcode in ospf6d. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
* | ospf6d: minor struct compare issues.Manoj Naragund2021-09-301-4/+13
|/ | | | | | | | | | | | | Problem Statement: Multiple struct compare using memcmp, which might result in issue due to structure padding/alignment. Fix: The code changes involve structure member by member comparison to remove any issues related to padding/alignment. Signed-off-by: Manoj Naragund <mnaragund@vmware.com> (cherry picked from commit 67db821a1d6d68b19862d50b68ed19278c5f2422)
* ospf6d: rework filtering commands to be in line with ospfdRenato Westphal2021-09-201-95/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #9535 describes how the export-list/import-list commands work differently on ospfd and ospf6d. In short: * On ospfd, "area A.B.C.D export-list" filters which internal routes an ABR exports to other areas. On ospf6d, instead, that command filters which inter-area routes an ABR exports to the configured area (which is quite counter-intuitive). In other words, both commands do the same but in opposite directions. * On ospfd, "area A.B.C.D import-list" filters which inter-area routes an ABR imports into the configured area. On ospf6d, that command filters which inter-area routes an interior router accepts. * On both daemons, "area A.B.C.D filter-list prefix NAME <in|out>" works exactly the same as import/export lists, but using prefix-lists instead of ACLs. The inconsistency on how those commands work is undesirable. This PR proposes to adapt the ospf6d commands to behave like they do in ospfd. These changes are obviously backward incompatible and this PR doesn't propose any mitigation strategy other than warning users about the changes in the next release notes. Since these ospf6d commands are undocumented and work in such a peculiar way, it's unlikely many users will be affected (if any at all). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #9019 from pjdruddy/ospfv3-early-break-list-walkRuss White2021-09-101-3/+10
|\ | | | | ospf6d: break early on route prefix mismatch
| * ospf6d: break early on route prefix mismatchPat Ruddy2021-07-201-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The route linked list in ospf6d is ordered in prefix batches which are associated with a the route node denoting the prefix. So if you look up the prefix in the tree and start walking the list, if you find a prefix which differs from the one you are interested in then you have gone beyond the batch of routes for that prefix. In some cases the route database linked list is used on a per-prefix basis. The existing code simply does a continue when the prefix does not match and continues to walk. This works with small numbers of routes because the walk continues through unrelated prefix batches and never finds anything to operate on. However if we have many thousands of routes these walks become expensive and can cause the SPF thread (amongst others) to run very long, causing issues with adjacencies where the dead timer is short. Add a break to these prefix-based loops to exit early if we get a prefix mismatch to avoid continuing down the route list if we have overshot. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* | ospf6d: add support for NSSA totally stub areasRenato Westphal2021-09-071-9/+9
| | | | | | | | | | | | | | | | | | Add a knob to turn a NSSA area into a totally stub area. In this configuration a Type-3 default summary route is generated by default. Syntax: `area A.B.C.D nssa no-summary`. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | ospf6d: fix logging of border router routesRenato Westphal2021-08-241-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prefix of routes to border routers consists of two pieces of information embedded in a single struct (prefix.u.lp): struct prefix { uint8_t family; uint16_t prefixlen; union { [snip] struct { struct in_addr id; struct in_addr adv_router; } lp; } u __attribute__((aligned(8))); }; As such, using prefix2str() (or the %pFX format specifier) isn't correct when logging such routes. This commit adds a few special cases here and there to handle OSPF6_DEST_TYPE_ROUTER routes differently. It'd probably be a good idea to add a helper function to handle all cases in a single place, but that can be left for a second moment. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisationRuss White2021-07-301-3/+5
|\ \ | | | | | | Ospfv3 ASBR summarisation feature
| * | ospf6d: Store ospf6 back pointer in route structMobashshera Rasool2021-07-211-3/+5
| | | | | | | | | | | | | | | | | | Storing the pointer to ospf6 struct in route struct. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* | | Merge pull request #9090 from opensourcerouting/ospfv3-fixes-20210720Donald Sharp2021-07-271-3/+3
|\ \ \ | |/ / |/| | ospf6d: small batch of random fixes/improvements
| * | ospf6d: move prefix_options from _path to _routeDavid Lamparter2021-07-201-3/+3
| |/ | | | | | | | | | | | | 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>
* / ospf6d: always generate default route for stubsRafael Zalamena2021-07-201-13/+0
|/ | | | | | | | | | | | | | | | | | In RFC 2328 OSPF Version 2, Section 12.4.3.1 "Originating summary-LSAs into stub areas" mentions that the stub areas should not import external routes and instead should generate a 'default summary-LSA' set to default destination. > In a stub area, instead of importing external routes > each area border router originates a "default summary- > LSA" into the area. The Link State ID for the default > summary-LSA is set to DefaultDestination, and the metric > set to the (per-area) configurable parameter > StubDefaultCost. Note that StubDefaultCost need not be > configured identically in all of the stub area's area > border routers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* ospf6d: Rename ospf6_is_router_abr to more accurately reflect what it doesDonald Sharp2021-06-101-4/+4
| | | | | | | | | | | | 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>
* ospf6d: Support for nssa in ospfv3Kaushik2021-06-041-21/+79
| | | | | | | | | | | | | 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>
* ospf6: fix memory leak in ospf6_abr_examin_summaryPat Ruddy2021-05-271-3/+3
| | | | | | | | | Ensure that if allocated route is not added to a table then it is deleted to avoid leaking memory. Add a new memory type for route table so that ospf6 routes can be distinguished in the show memory output in isolation. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* ospf6d: Fix when an "export-list" or "filter-list out" is applied.lynne2021-05-041-2/+25
| | | | | | | | | | | | | | | | | 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>
* Merge pull request #8057 from ranjanyash54/default-routeRuss White2021-03-301-0/+17
|\ | | | | ospf6d: Default Route functionality
| * ospf6d: Minor changes for stub areaYash Ranjan2021-03-291-0/+14
| | | | | | | | Signed-off-by: Yash Ranjan <ranjany@vmware.com>
| * ospf6d: Add logic to set metric if route-map not presentYash Ranjan2021-03-291-0/+3
| | | | | | | | Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | ospf6d: fix ospf6_abr_examin_summary to check for a path cost changeKaren Schoener2021-03-261-1/+2
|/ | | | | | Fixes a regression in test case: anvl-ospfv3-16.14. Signed-off-by: Karen Schoener <karen@voltanet.io>
* Merge pull request #8035 from qlyoung/remove-more-sprintfMark Stapp2021-02-231-2/+4
|\ | | | | *: remove more sprintf()
| * *: remove more sprintf()Quentin Young2021-02-091-2/+4
| | | | | | | | | | | | | | Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
* | ospf6d : fix issue in ecmp inter area routeSoman K S2021-02-101-12/+39
|/ | | | | | | | | | | | | | Issue: When a path in the inter area ecmp route is deleted, the route is removed Fix: The fix is to remove the specific path from the inter area route using ospf6_abr_old_route_remove() when abr route entry is not found. In the function ospf6_abr_old_route_remove() the path to be removed needs to match adv router and link state ID Fixed memory leak in ospf6_intra_prefix_update_route_origin() caused by route node lock not getting released. Signed-off-by: kssoman <somanks@gmail.com>
* ospf6d: Remove #if 0 code that has not been used in a long timeDonald Sharp2021-01-281-13/+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: Json support added for command "show ipv6 ospf6 database [json]"Yash Ranjan2021-01-131-14/+41
| | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 database" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* ospf6: get instance from route table scopeIgor Ryzhov2020-11-301-38/+32
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Merge pull request #7448 from mjstapp/fix_gcc10_formatsDonald Sharp2020-11-101-8/+5
|\ | | | | * : clean up format specifiers for gcc-10
| * * : clean up format specifiers for gcc-10Mark Stapp2020-11-041-8/+5
| | | | | | | | | | | | | | | | gcc 10 complains about some of our format specs, fix them. Use atomic size_t in thread stats, to work around platform differences. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6Rafael Zalamena2020-11-031-49/+51
|\ \ | |/ |/| ospf6d : Transformation changes for ospf6 vrf support.
| * ospf6d : Transformation changes for ospf6 vrf support.harios_niral2020-10-311-49/+51
| | | | | | | | | | | | | | | | 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>
* | :* Convert prefix2str to %pFXDonatas Abraitis2020-10-221-64/+37
|/ | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* ospf6d : Preparing for ospf6d VRF support.Kaushik2020-09-011-1/+1
| | | | | | | | | 1. Removed the VRF_DEFAULT dependency from ospf6d. 2. The dependency on show command still exist will be fixed when the ospf6 master is available. Co-authored-by: Harios <hari@niralnetworks.com> Signed-off-by: Kaushik <kaushik@niralnetworks.com>
* ospf6d: pre-fix coccinelle hang pointsDavid Lamparter2020-07-141-18/+9
| | | | | | coccinelle gets stuck in a few locations in ospf6d... Signed-off-by: David Lamparter <equinox@diac24.net>
* ospf6d: stop looping thru same Inter-Area Router LSAsDon Slice2020-04-091-3/+17
| | | | | | | | | | | | | Processing loop uncovered when there are multiple ABRs also acting as ASBRs into the same area in ospf6. The problem was that when looking thru the list of Inter-area router entries, if the current entry being processed matched, it still merged next-hops and re-initiated the process. In this fix, if the route/path matches and the next-hops also match, there is no need to re-initiate the examine process. Ticket: CM-28900 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>