summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_intra.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospf6d: fix ospf6 crash in inp lsa processingChirag Shah2018-10-121-1/+1
| | | | | | | | | | | | | | | Use ospf6_prefix_same for comparing two exact same prefix to determine ECMP for a route. ospf6_route_cmp expects two different prefix rather being exactly same. Ticket:CM-22630 Testing Done: performed ECMP of intra network prefix route via sending same route via different available ospf6 paths. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: OoB read (Coverity 1221444 1221446)paco2018-06-291-2/+3
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* ospf6d: null check (Coverity 1468510)paco2018-06-251-0/+2
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* ospf6d: Fix ECMP for asbr external routesChirag Shah2018-05-171-0/+2
| | | | | | | | | | | | | | | | | | Use brouter table to fetch nexthops for asbr prefix (external) routes. Change adv. router of the router's path once the DB/FIB is updated with effective nexthops. Cleanup of nexthop update when route's adv router changes cost. Ticket:CM-16139 Testing Done: Tested ASBR external routes in CLOS topology with multiple paths asbr originator at tor to spine. Validated external route's nexthop within area and inter area. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: Fix ABR brouter calculation corruptionChirag Shah2018-05-091-9/+24
| | | | | | | | | | | | | | | | | | | During Intra brouter calculation, brouters will be marked for remove. if one of the brouter is removed, as part of its remove callback, ospf6_abr_examin_summary is performed where marked for brouter would be removed. Since refcount of next brouter node still higher, it will retain one node with dangled next brouter pointer. When intra brouter calculation iteration goes to next node, where accessing free node causes a crash. Ticket:CM-20807 Testing Done: Configure multilple ABR routers between area 0 and area x, y. Remove ospf6 configuration on area x, y abrs and check area 0 Intra brouter calculations. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: fix intra prefix ecmpChirag Shah2018-05-021-222/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are multiple advertisers/paths to reach Intra-Prefix route, if any path is removed, re-added back, it does add to the same route node. ospf6 intra prefix, first stored in oa->route_table then as part of add cb, it would add to ospf6->route_table which adds to FIB. When copying a route with its paths & NHs from oa->table to ospf6->table the path origin should not be modified otherwise ospf6->table would not find existing node rather it appends new node. Use spf_table to fetch nexthops for a given advertisers/path, to form effective nexthop list for a route. Ticket:CM-16139 Testing Done: R2 ---- R3 | | R1 ---- R4 Inject Intra Ara Prefix LSA from R1 & R3, validate R2 and R4 having two origination point/paths to reach for a route. Trigger link flap, frr restart or remove/readd R3's INP one of the injection point. Remove link between R4 to R1 and validate R3 carrying single path to reach prefix. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: assert nh list is non-nullQuentin Young2018-04-131-0/+1
| | | | | | clang-analyze Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: ECMP for Intra Area Prefix routesChirag Shah2018-04-061-18/+423
| | | | | | | | | | | | | | | | | | | | Handle ECMP for Intra Area Prefix LSAs routes. Ticket:CM-16139 Testing Done: Configure ospf6 passive interface R2 and R3 with same prefix address. Check Intra Area Prefix LSA update at R1 and R3 which would have ECMP paths with effective two paths and two nexthops (from R2 and R4). stop frr at R3 and R1 and R4 route changes back to one nexthop and one paht. R1 ---- R2 | | R3 ---- R4 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: fix loop in ABRsChirag Shah2018-03-291-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When two routers from same area connected to backbone, intra route advertised from area x should take precedence within area x. The same route would be injected as summary lsa to area 0/y. The same LSA via second abr injected back to area x and since area 0 is lower than area x its route take precedence. Move the area check below path type and cost as both are crucial to determine best route. Ticket:CM-19627 Testing Done: Initial route generated via area 1 as Intra-Prefix LSA (2009). R1 and R2 both re advertised Inter Area Prefix LSA (Summary LSA 2003) to area 1. With the change area 1 Intra route precedence is preserved. The address of H1 from Right is reachable via ping. area 1 | area 0 R1 / \ / \ / \ H1 --Left Right \ / \ / \ / R2 area 1 | area 0 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-12/+12
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: retain inter area border router type-4Chirag Shah2018-03-221-0/+30
| | | | | | | | | | | | | | | | | During Intra area border router calculation, all border routers are marked for remove from brouter table. Once SPF calculation is done, retain inter area border router if the adv. intra border router (abr) is present in SPF table. Ticket:CM-20171 Testing Done: Validated inter area ASBR (L1) is retained at R1 and R2 post intra border router calculation. L1 -- (area 1)-- L2 -- (area 0) -- R1 --- R2 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: Intra-prefix LSA update after frr restartChirag Shah2018-03-081-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | 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-60/+57
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* ospf6d: Fix External routes ECMPChirag Shah2018-01-021-1/+2
| | | | | | | | | | | | | | | | | | Handle RFC 2328 16.4 Calculating AS external routes with ECMP For ASBR route, if it is learnt via new LSA and contains different nexthop list. First lookup route in ospf6 route table if it exists, merge nexthop list to existing and call the callback to install into FIB (zebra). Delete created new route as it is identical to existing entry in route table. Ticket:CM-16139 Testing Done: Run two ASBR with 2 ECMP paths from each DUT neighbor receievs 4 ECMP path to a external route. ospf6 installs all 4 ECMP path to FIB/RIB Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: SPF consider all Router LSAsChirag Shah2017-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on RFC-5340, there could be multiple Router LSAs associated with Same Advertising Router. During SPF calculation ensure first Root Vertex accommodates all Link state IDs for its originated Router LSAs push them into priority queue. Similarly follow for other Vertexes, considering Router LSAs with multiple Link State IDs. Ticket: CM-18069 Testing Done: Topology: R1 === R2 -- R3 Validated with more than 100 Subinterfaces between R1 === R2 with broadcast links, Validated show ipv6 ospf6 spf tree containing all graph nodes. Validated ip -6 route at R3 and all intra prefix LSAs route installed with ospf6 as protocol. 2) Run R1 === R2 with Point-to-Point links. 3) Perform few other abr and ospf6 test cases of LSA ageout, route install and delete cases. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: Divide LSupdate to keep size smallChirag Shah2017-10-201-9/+118
| | | | | | | | | | | | | | | | | | | | Within OSPFv3 area, Disect Router LSA and Intra-prefix LSA in order to keep LSA size Small. Each LSA has unique Link State ID assigned. Intra-Area-Prefix LSA: Spread prefixes across multiple intra-area-prefix-LSAs. Ticket:CM-18069 Testing Done: Tested 92 ospf6 enabled (point-to-point) interfaces between two routers. 92 adajancy comes up with Full Neighborship. Validated 'show ipv6 ospf6 database router detail' & 'show ipv6 ospf6 database intra-prefix detail', each adv-router has two distinct LSA of such catgory. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: fix clang warning, NULL() callsVincent JARDIN2017-10-081-13/+33
| | | | | | | Avoid show() methods from being a NULL function when it is called. Meanwhile, I did const'ify the handlers so only its debug field can be changed. Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
* ospf6d: fix heap use after freeQuentin Young2017-09-251-1/+14
| | | | | | | | | | | | | | | | | | | | During the loop we save a pointer to the next route in the table in case brouter is deleted during the course of the loop iteration. However when we call ospf6_route_remove this can trigger ospf6_route_remove on other routes in the table, one of which could be pointed at by said pointer. Since ospf6_route_next locks the route that it returns, it won't actually be deleted, instead the refcount will go to 1. In the next loop iteration, nbrouter becomes brouter, and calling ospf6_route_next on this one will finally decrement the refcount to 0, resulting in a free, which causes subsequent reads on brouter to be UAF. Since the route will have OSPF6_ROUTE_WAS_REMOVED set, provided the memory was not overwritten before we got there, we'll continue on to the next one so it is unlikely this will cause a crash in production. Solution implemented is to check if we've deleted the route and continue if so. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: New version of GCC with new warningsDonald Sharp2017-07-281-1/+1
| | | | | | | | GCC 7.1.1 returned warnings about buffer sizes not being big enough to handle the full string that could be generated. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-3/+2
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-2/+3
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-1601/+1540
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into table-hash-ospf6-lsdb-refactorDavid Lamparter2017-07-141-30/+29
|\ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: remove VTYNL, part 4 of 6David Lamparter2017-07-141-29/+28
| | | | | | | | 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-19/+19
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ospf6d: use macro for LSDB walksDavid Lamparter2017-07-111-8/+4
|/ | | | | | ... to make it easier to refactor all of the iteration uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'stable/3.0'David Lamparter2017-06-131-2/+7
|\ | | | | | | | | | | | | | | | | | | | | Dropped: redhat/README.rpm_build.md redhat/daemons redhat/frr.init redhat/frr.logrotate redhat/frr.spec.in Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: fix heap uafQuentin Young2017-06-061-2/+7
| | | | | | | | | | | | Fix #667 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp2017-05-241-1/+2
|\|
| * ospf6d: fix use-after-freeQuentin Young2017-05-221-1/+2
| | | | | | | | | | | | | | ospf6_route_remove may free the ospf6_route passed to it if the refcount reaches zero, in which case zeroing the ->flag field constitutes a uaf Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: 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>
* lib, ospf6d: Refactor if_lookup_prefixDonald Sharp2017-03-151-1/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use monotime()David Lamparter2017-01-231-2/+2
| | | | | | This is largely a bulk-replace made with coccinelle. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: add 'int idx_foo' argv index variablesDaniel Walton2016-09-231-2/+4
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* ospf6d: argv updateDaniel Walton2016-09-231-2/+2
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* *: use void * for printing pointersDavid Lamparter2016-05-301-3/+4
| | | | | | | | | On higher warning levels, compilers expect %p printf arguments to be void *. Since format string / argument warnings can be useful otherwise, let's get rid of this noise by sprinkling casts to void * over printf calls. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: Fix double increment of Sequence NumberDonald Sharp2016-01-191-24/+0
| | | | | | | | | | | | When OSPF6 is creating the header for the ROUTER LSA type if the packet being sent has interface information to add to the data, the Sequence Number is at least double incremented. This change moves the header creation to outside the loop over all interfaces in the area. Additionally the header is created at the bottom of the function now. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Quagga: prefix2str fixupDonald Sharp2015-11-231-4/+4
| | | | | | | During CR for nexthop upstream it was noticed that usage of prefix2str was not consistent. This fixes this problem Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Fixup compiler warnings for powerpcDonald Sharp2015-07-271-3/+3
| | | | | | The turn-on of -Werror was never run fully against powerpc. there were some powerpc specific issues that turned up. This commit fixes these issues.
* Fixing a couple of issues with ospf6_route_remove () routine.Donald Sharp2015-05-201-6/+9
| | | | | | | | | | | | | | | | | When a route_node has multiple ospf6_routes under it (common subnet case), then the current implementation has an issue in adjusting the route_node->info on a ospf6_route_remove() call. The main reason is that it ends up using exact match to determine if the next ospf6_route belongs to the same route_node or not. Fixing that part to use rnode (the existing back-pointer to the route_node) from the ospf6_route to determine that. Also fixing some of the walks to turn them safe so that the route deletion is fine. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* LA (local-address) bit related inter-op fix.Donald Sharp2015-05-201-3/+2
| | | | | | | | | | | | | | As per the RFC, when the NU bit is set, prefix should be ignored. However, the code is currently ignoring prefix with LA bit too. Fixing that part. In future, we should also set LA bit for the loopback addresses. Not doing this part right away, as quagga wont be backward compatible with its own previous releases. Maybe after a release or so, we should start setting LA bit too. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* ospf6d: ospfv3-stub-area-support.patchDonald Sharp2015-05-201-21/+36
| | | | | | | Support stubby and totally stubby areas in OSPFv3 Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
* ospf6d: ospfv3-abr-ecmp-support.patchDonald Sharp2015-05-201-11/+28
| | | | | | | OSPFv3: Add ABR support and make ECMP > 4. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
* ospf6d: add SPF logs, statistics, and display of SPF parametersDinesh Dutt2013-11-081-1/+1
| | | | | | | | Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> [DL: adapted to rebase / readded randomly lost line] [DL: killed timeval_subtract] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: handle Prefix and Router Options bits correctlyDinesh Dutt2013-11-081-0/+4
| | | | | | | | | | Ensure that prefixes with the NU/LA bit set do not get added to the routing table. Ensure that routers with the V6/R bit set do not get added as transit routes. Signed-off-by: Dinesh Dutt <ddutt at cumulusnetworks.com> [DL: adjust to rebase] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: add LSA payload to show summary outputDinesh Dutt2013-11-081-4/+197
| | | | | | | | | | | | | | | | | Unlike OSPFv2, the LSID of an LSA isn't sufficient to know what the contents of the LSA are. Its useful for debugging and basic eyeball tests to see the contents of the LSA in the simple tabular format of "show ipv6 ospf6 database". This patch adds that output to the command. It replaces the existing fields of "duration, Chksum and Length" with a single field called Payload which is dependent on the LSA type. For Inter-Area Prefix, Intra-Area Prefix and AS-External LSAs, this will be the advertised prefix/prefix length, for Router LSAs, it is RtrID/IfID etc. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> [DL: rebase fix, line disappeared in ospf6_abr_originate_summary_to_area] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: add overload supportDinesh Dutt2013-11-081-0/+23
| | | | | | | | | | | | | | OSPFv3: Support setting/clearing overload bit on router It is sometimes necessary for a router to gracefully remove itself from the SPF tree i.e. it cannot act as a transit router. It does this by setting the overload bit in the router LSA. This patch adds support for enabling/disabling the overload bit. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com> [DL: patch applied with fuzz] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: correct nexthop through directly connected networksDinesh Dutt2013-11-081-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is implementing this part of RFC 2328: This is the "first case", see below, 16.1.1. The next hop calculation ... If there is at least one intervening router in the current shortest path between the destination and the root, the destination simply inherits the set of next hops from the parent. Otherwise, there are two cases. In the first case, the parent vertex is the root (the calculating router itself). This means that the destination is either a directly connected network or directly connected router. The outgoing interface in this case is simply the OSPF interface connecting to the destination network/router. ... The current Quagga code always tries to inherit the nexthop from a parent vertex, but does not cover the case that the destination is directly connected to the root vertex. This patch adds support for that case. Signed-off-by: James Li <jli at cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: don't suppress empty router LSADinesh Dutt2013-11-081-29/+20
| | | | | | | | | | | | | | Currently in OSPFv3 implementation, if all the interfaces are down/loopback or are without any full adjacencies, the router LSA is suppressed. So for a router with only stub networks, no router LSA is generated. However, intra-prefix LSAs are generated for the stub networks and these intra-prefix LSAs will reference the router LSA. So the router LSA really should not be suppressed. It needs to be generated to be the starting vertex for SPF w.r.t the stub networks. Signed-off-by: James Li <jli at cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>