summaryrefslogtreecommitdiffstats
path: root/ospf6d (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospf6d: Stop debug messages happening in rare caseDonald Sharp2018-03-141-1/+2
| | | | | | | | When we have a interface disabled in ospfv3 and we are receiving messages on it. We will spam the log file repeatedly. Debug guard the message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1814 from chiragshah6/mdevJafar Al-Gharaibeh2018-03-094-4/+46
|\ | | | | ospf6d: assign zebra router-id to ospf6 instance
| * ospf6d: assign zebra router-id to ospf6 instanceChirag Shah2018-03-014-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store zebra router-id in global structure. Before router ospf6 instance created, zebra router-id callback called. During ospf6 main execution zebra init happens, but default instance does not execute until cli replay 'router ospf6'. Call ospf6_router_id_change during 'router ospf6' to assign zebra router id to ospf6 instance. Ticket:CM-19937 Testing Done: Assign Loopback /32 (6.6.6.6/32) address, restart frr with (router ospf6 in frr.conf). ospf6 default instance assigned 6.6.6.6 router-id. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-0617-364/+371
| | | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
* | ospf6d: ECMP for external routesChirag Shah2018-03-014-56/+267
|/ | | | | | | | | | | | | | | | | | | | | The route being added check its origin matches, with any of the existing path (list of paths). Remove the existing path, add if its cost is eqaual or less than any of the existing path. For a given route and of existing path cost is lower (better) than one being added, discard new route update. The existing path cost is higher (lower) than one being added, ospf6_route_add replaces existing with new route info. Compare cost between delete request and with existing route. Ticket:CM-16139 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* Merge pull request #1754 from chiragshah6/ospfv3_devJafar Al-Gharaibeh2018-02-155-6/+38
|\ | | | | ospf6d: Router-ID change notify to restart ospf6d
| * ospf6d: router-id change notify to restart ospf6dChirag Shah2018-02-155-6/+38
| | | | | | | | | | | | | | | | | | | | | | Notify user to store config and restart ospf6d as part of router-id change cli if any of the area active. Store zebra router-id under ospf6, when static router-id removed restore zebra router-id, ask to restart ospf6d. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | Merge pull request #1752 from donaldsharp/coverity_1Jafar Al-Gharaibeh2018-02-151-12/+15
|\ \ | | | | | | Coverity 1
| * | ospf6d: Fix a possible deref by null found in SADonald Sharp2018-02-141-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | There exists a possibility that rtr_lsa may be null. Add an assert that shows we actually expect it to be non-null at this point in time going forward. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | Merge pull request #1742 from chiragshah6/mdevJafar Al-Gharaibeh2018-02-151-0/+4
|\ \ \ | |_|/ |/| | ospf(6)d: Fix distance option command
| * | ospf6d: Fix distance commandChirag Shah2018-02-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reset prevoiusly configured distance command options if user enters new (different) parameters. Ticket:CM-19635 Reviewed By: Testing Done: R1(config-ospf6)# distance ospf6 intra-area 55 external 55 R1#show running-config ospf6d router ospf6 distance ospf6 intra-area 55 external 55 R1(config-ospf6)# distance ospf6 inter-area 55 R1#show running-config ospf6d router ospf6 distance ospf6 inter-area 55 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | | ospf6d: Handle Premature Aging of LSAsChirag Shah2018-02-1513-16/+187
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | *: Track vrfs per nexthop not per route entryDonald Sharp2018-02-092-3/+1
|/ | | | | | | Track the vfrs on a per nexthop basis instead of on a per route entry basis. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: Fix redist w/ route-map during restartChirag Shah2018-01-267-6/+89
| | | | | | | | | | | | | | | | | | | | Add hook for route-map update event. Add a delay one shot timer to accomodate route-map update and reset redist with zebra to process all redistribute routes with route-map info. Cleanup route-map, prefix cached date during ospf6 exit. Ticket:CM-13800 Testing Done: configure redistribute connected with route-map to define type-2 routes. Restart frr.service and validated route-map add,update event, thread is scheduled, once timer is done redist reset with zebra. Upon redist add notification, all route map info is cached in ospf6 and processed as type-2 route and send ASE E2 LSA. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* Merge pull request #1664 from chiragshah6/ospfv3_devRuss White2018-01-247-143/+266
|\ | | | | ospf6d: SPF calculation w/ multiple Router LSAs originated from given Adv Router
| * ospf6d: spf calculation w/ multiple router lsasChirag Shah2018-01-237-143/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An OSPFv3 enabled Router can originate or receive multiple Link State-IDs for Router LSAs. As per RFC 5340 A 4.3, more than one Router LSAs, from given Vertex is considered (as concatenated) single large Router LSA. Created hidden show command to simulate concatenated large LSA from advertising/self Router LSAs. Ticket:CM-19329 Reviewed By: Testing Done: Simulate 160 subinterfaces between R1 === R2--R3, This triggers R1 and R2 to generate multiple link state IDs for Router LSAs. During SPF calculation only aggregated single router LSA processed and SPF tree formed. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | Merge pull request #1618 from donaldsharp/zebra_startup_orderingPhilippe Guibert2018-01-231-0/+3
|\ \ | |/ |/| zebra route-leaking for static routes
| * *: Send/receive the nexthop vrf_idDonald Sharp2018-01-121-0/+3
| | | | | | | | | | | | | | Modify the code to send and receive to/from zebra the nexthops vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #1566 from chiragshah6/ospfv3_devJafar Al-Gharaibeh2018-01-1811-16/+354
|\ \ | | | | | | ospf6d: Fix External routes ECMP
| * | ospf6d: Fix External routes ECMPChirag Shah2018-01-0211-16/+354
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add protocol stats and show commandChirag Shah2018-01-163-2/+142
|/ | | | | | | | | | | | | | | | Add OSPFv3 Protocol incoming/outgoing packets stats. r3# show ipv6 ospf6 interface traffic Interface HELLO DB-Desc LS-Req LS-Update LS-Ack Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx -------------------------------------------------------------------------------------------- swp1 3/4 2/2 0/2 8/6 3/2 swp2 3/4 2/2 0/1 7/3 2/0 swp3 0/4 0/0 0/0 0/0 0/0 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: Fix ospf6 redist with route-mapChirag Shah2017-12-301-2/+13
| | | | | | | | | | | | | | | | | | | When ospf6 configure with redistribute connected/protocol with route-map. Upon restart of frr.service, ospf6 receives redistribute update then route-map update. During redistribute route update, since route-map info is not filled, route is suppressed from injected as external route. Fix: reset redistribute when route-map update received matches with redistribution (type) and route-map name. Ticket:CM-13800 Testing Done: Configure ospf6 redistribute with route-map to inject Type-2 external routes into database. Trigger frr restart redistribute with route-map happens. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: Don't assign to values that are never readDonald Sharp2017-12-141-5/+5
| | | | | | | | | offset and offsetlen are never used without reassigning in the code. So comment out the assignments and in case we want to start using the code for snmp changes in the future. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: Fix multi nexthop route removeChirag Shah2017-12-061-7/+19
| | | | | | | | | | | | | | | Fix sorting of route storage to DB. Fix two list comparison which allows route with multiple nexthop to updates. Ticket:CM-19025 Testing Done: Configured a topology where ospf6 learn ecmp route via one neighbor and upon removal of intra-prefix route from origin, DUT removes ECMP intra-prefix route from RIB. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* Merge pull request #1464 from chiragshah6/mdevRuss White2017-11-294-74/+181
|\ | | | | ospf6d: SPF consider all Router LSAs
| * ospf6d: SPF consider all Router LSAsChirag Shah2017-11-174-74/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | *: Make zapi route install Notifications optionalDonald Sharp2017-11-271-1/+1
|/ | | | | | | | | | | Allow the higher level protocol to specify if it would like to receive notifications about it's routes that it has installed. I've purposely made it part of zclient_new_notify because we need to track the routes on a per daemon basis only. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: Fix setting interface ipv6 ospf6 cost value (LSA hooks were never ↵Juergen Kammer2017-11-091-9/+14
| | | | | | | | | | | | called) Fixes: #1420 Signed-off-by: Juergen Kammer <j.kammer@eurodata.de> If the ipv6 ospf6 cost on an interface is changed, no recalculation of routes happens, though the interface structure is updated with the new value. The new cost will be used later, when LSA hooks are called for any other reason. Diagnosis: The DEFUN for the config command sets oi->cost and calls ospf6_interface_recalculate_cost(oi) whenever there is a change in the supplied value. ospf6_interface_recalculate_cost then gets the new cost for the interface by calling ospf6_interface_get_cost(oi), which returns oi->cost if a cost is manually set (i.e. we get the value we just set). ospf6_interface_recalculate_cost only calls the LSA hooks if there is a change - which obviously never happens if we compare the new value with itself.
* lib, ospf6d, ospfd, zebra: Add ZEBRA_STRDonald Sharp2017-10-251-1/+1
| | | | | | Allow us to use a ZEBRA_STR for commands Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Modify zclient_init to require privs dataDonald Sharp2017-10-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: Make 'struct zebra_privs_t' availableDonald Sharp2017-10-242-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: Divide LSupdate to keep size smallChirag Shah2017-10-202-9/+119
| | | | | | | | | | | | | | | | | | | | 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: Handle lsupdate upto max ospf6 payloadChirag Shah2017-10-172-32/+107
| | | | | | | | | | | | | | | While traversing LSUpdate list, if LSUpdate message fills up (w/ LSAs) to the interface MTU size, Send the existing filled LSUpdate message if max payload exceeds max ospf6 payload, reset sendbuf (buffer) to fill rest of the remaining LSAs. Add relevant fields to debugs. Ticket:CM-18069 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* Merge pull request #1300 from chiragshah6/mdevJafar Al-Gharaibeh2017-10-172-5/+5
|\ | | | | ospf6d: fix ospf6d crash during sigterm/shutdown
| * ospf6d: fix ospf6d crash during sigterm/shutdownChirag Shah2017-10-062-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During signterm (shutdown) ospf6_clean calls route_remove for brouter_table, during route_remove brouter_table remove hook function is invoked which in turns calls router_remove is any of the LSA has max age or cost is infinity, which leads to stack corruption trying to delete same route node. Similar to 'no router ospf6' or 'no area ..' command where lsdb is cleanedup then brouter route table clean up is called. Clean some of route trace to have route related fields. Ticket:CM-17932 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | Merge pull request #1298 from opensourcerouting/iface-rb-treeDonald Sharp2017-10-166-19/+22
|\ \ | | | | | | Use rb-trees to store interfaces instead of linked-lists
| * | *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-104-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: Add missing vrf lookupDonald Sharp2017-10-101-0/+2
| | | | | | | | | | | | | | | | | | The vrf lookup was missed in this conversion? Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | *: introduce new rb-tree to optimize interface lookup by ifindexRenato Westphal2017-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance tests showed that, when running on a system with a large number of interfaces, some daemons would spend a considerable amount of time in the if_lookup_by_index() function. Introduce a new rb-tree to solve this problem. With this change, we need to use the if_set_index() function whenever we want to change the ifindex of an interface. This is necessary to ensure that the 'ifaces_by_index' rb-tree is updated accordingly. The return value of all insert/remove operations in the interface rb-trees is checked to ensure that an error is logged if a corruption is detected. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | *: eliminate IFINDEX_DELETED in favor of IFINDEX_INTERNALRenato Westphal2017-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | IFINDEX_DELETED is not necessary anymore as we moved from a global list of interfaces to a list of interfaces per VRF. This reverts commit 84361d615. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-104-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | lib: nuke the if_*_by_name_len() functionsRenato Westphal2017-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | Make use of strnlen() and strlcpy() so we can get rid of these convoluted if_*_by_name_len() functions. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | ospf6d: Make ospf6_prefix have an empty v6 addr at endDonald Sharp2017-10-111-0/+1
|/ / | | | | | | | | | | | | | | | | The `struct ospf6_prefix` type expects to have space allocated at the end of the structure for a v6 prefix. So let's tell the compiler that there might be more there. This is to fix a coverity scan warning. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | ospf6d: Fix snmp compile breakageDonald Sharp2017-10-091-1/+1
| | | | | | | | | | | | | | The recent clang fixes for Static Analysis were run without compiling `--enable-snmp` these changes broke the snmp build. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | ospf6d: fix clang warningVincent JARDIN2017-10-081-2/+3
| | | | | | | | | | | | troute and tinfo needs to be 0'd Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
* | ospf6d: fix clang warning, NULL() callsVincent JARDIN2017-10-085-65/+109
|/ | | | | | | 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>
* *: use argv[]->text instead of argv[]->arg when appropriateRenato Westphal2017-10-061-8/+8
| | | | | | | | Incomplete commands like "debug ospf6 route mem" were being ignored. The changes in ripd and ripngd are intended to make the code easier to read, no bugs were fixed in these two daemons. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-055-6/+6
| | | | | | | | | | | | | | | | | | | Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: add debug ospf6 route memory to configChirag Shah2017-10-041-0/+3
| | | | | | vty config write to display 'debug ospf6 route memory'. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.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>