summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_topology.c
AgeCommit message (Collapse)Author
2021-03-22eigrpd: kill eigrp_memory.h, use MTYPE_STATICDavid Lamparter
Same as previous commit -- convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-01-30eigrpd: Prevent uninitialized value from being usedDonald Sharp
valgrind is finding: 2141982-==2141982== Conditional jump or move depends on uninitialised value(s) 2141982:==2141982== at 0x11A7A6: eigrp_metrics_is_same (eigrp_metric.c:134) 2141982-==2141982== by 0x120360: eigrp_topology_update_distance (eigrp_topology.c:374) 2141982-==2141982== by 0x124F01: eigrp_get_fsm_event (eigrp_fsm.c:284) 2141982-==2141982== by 0x12519E: eigrp_fsm_event (eigrp_fsm.c:419) 2141982-==2141982== by 0x1206A1: eigrp_topology_neighbor_down (eigrp_topology.c:518) 2141982-==2141982== by 0x11AB3A: eigrp_nbr_delete (eigrp_neighbor.c:178) 2141982-==2141982== by 0x124494: eigrp_finish_final (eigrpd.c:271) 2141982-==2141982== by 0x1245A8: eigrp_finish (eigrpd.c:247) 2141982-==2141982== by 0x124630: eigrp_terminate (eigrpd.c:240) 2141982-==2141982== by 0x11344B: sigint (eigrp_main.c:112) 2141982-==2141982== by 0x48F5F32: quagga_sigevent_process (sigevent.c:130) Prevent this from happening. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-12eigrpd: Introduce eigrp_metric.[ch] and eigrp_types.hDonnie Savage
Add these file and introduce some new fundamental types Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie Savage <diivious@hotmail.com>
2021-01-12eigrpd: Rename nexthop_entry and prefix_entry to better namesDonnie Savage
Rename struct eigrp_nexthop_entry to struct eigrp_route_descriptor Rename struct eigrp_prefix_entry to struct eigrp_prefix_descriptor Fix all the associated function names as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie SAvage <diivious@hotmail.com>
2020-10-22:* Convert prefix2str to %pFXDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-02*: Convert prefix_free to double pointerDonald Sharp
Have the prefix_free code take a double pointer to free the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06eigrpd: Update eigrp_topology.c to not use VRF_DEFAULTDonald Sharp
Push out the pass in of struct eigrp to all functions in eigrp_topology.c so we do not lookup the eigrp pointer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06eigrpd: Convert eigrp_zebra.c to use appropriate vrf_idDonald Sharp
Use the appropriate vrf_id in eigrp_zebra based off of the struct eigrp *eigrp. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06eigrpd: Add `router eigrp AS [vrf NAME]` and various stuffDonald Sharp
Add the ability to parse `router eigrp AS [vrf NAME]` and modify eigrp_lookup to actually handle a vrf_id for us. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-11eigrpd: Correctly handle the ref-count in a couple of spotsDonald Sharp
The ref count for the eigrp topology table was incorrect in a couple of spots. Let's clean it up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-03eigrpd: Modify code to pass down metric to zebraDonald Sharp
Modify EIGRP code to pass its used metric down to zebra. Additionally update topotests to pass with these changes. Fixes: #3703 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-24Treewide: use ANSI function definitionsRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-23eigrpd: Fix memory leaks and remove dead/unused functionsDonald Sharp
During shutdown we were not properly cleaning up some memory as reported by valgrind. Additionally during cleanup operations I noticed that there were some dead/unused functions remove/reduce. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14eigrpd: Convert to use LIB_ERR_XXX for zlog_errDonald Sharp
Convert, where appropriate, to using LIB_ERR_XXX for zlog_ferr Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-25eigrpd ospfd: null chk (Coverity 1458168 1455335)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-21eigrpd: null check (Coverity 1455334 and 4 alike)paco
Coverity issues fixed with this commit: 1455334 1455335 1455336 1455337 1455339 Signed-off-by: F. Aragon <paco@voltanet.io>
2018-05-04eigrpd: Consider only feasible successors as successorsPiotr Jurkiewicz
Meeting the feasibility condition is required also for routes meeting the variance condition. Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-24eigrpd: Convert topology list to a tableDonald Sharp
The EIGRP topology list is an extremely inefficient way to store data about the known routes. Convert to using a table. Signed-off-by: Donald Sharp <sharpd@cumulusnetorks.com>
2017-10-05*: Convert list_free usage to list_deleteDonald Sharp
list_free is occassionally being used to delete the list and accidently not deleting all the nodes. We keep running across this usage pattern. Let's remove the temptation and only allow list_delete to handle list deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
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>
2017-09-05Merge pull request #1051 from donaldsharp/plistsDavid Lamparter
Refactor Access and Prefix Lists application
2017-08-26eigrpd: eigrp_neighbor_entry to eigrp_nexthop_entryDonald Sharp
The struct 'eigrp_neighbor_entry' really represents a nexthop for a prefix. Rename the structure to better represent what we are representing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Cleanup various SA IssuesDonald Sharp
1) Handle key value not found on interface 2) Handle various NULL pointer possibilities 3) Fix possible integer overflow 4) Fix memory leak 5) Check return codes on sscanf Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Fix distance comparisonDonald Sharp
The distance comparison for when we received an internal and we already had an internal was overriding the metrics of the connected. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Fix compiler warning introducedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Refactor eigrp_topoloy_table_lookup_ipv4Donald Sharp
Allow eigrp_topology_table_lookup_ipv4 to use 'struct prefix' Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Refactor to use 'struct prefix' for eigrp_zebra.hDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Convert pe->destination_ipv4 to pe->destinationDonald Sharp
Convert the destination_ipv4 to a struct prefix and just call it destination. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: No need to create TLV typeDonald Sharp
There is no need to create a TLV type to pass in for the FSM message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Remove union from FSM msgDonald Sharp
Remove the union of passing the TLV and just pass the metric in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Improve external route distance comparisonDonald Sharp
If the new nexthop is external while the previous best was Internal or Connected, it should always loose. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: make fsm msg data_type an enumDonald Sharp
We need to eventually be able to handle multiple data types to figure out if the distance is better worse. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Refactor FSM callingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Fix memory leak in FSMDonald Sharp
The FSM was never freeing the msg. Since we do not have a special queue for it, just don't allocate the memory. In the future we can put this back. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15eigrpd: cleanup eigrp_topology_update_distanceDonald Sharp
Cleanup eigrp_topology_update_distance to return an enum of whether or not the metric has changed or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-13eigrpd: Fix integer overflow possibilityDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-26*: do not take address of packed memberQuentin Young
May result in alignment errors on certain platforms Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
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>
2017-05-13eigrpd: Diverse FixesRenato Westphal
* Correct the metric calculation as well as the default metrics; * Do not show invalid routes in the "show ip eigrp topology". * Add support to VRFs; * When downloading a neighbor remove the related routes; * Fix bugs in the parser of packages they were creating Invalid default routes; * Add and remove routes in the zebra; * Add command "on router eigrp AS"; * Make "delay" and "bandwitch" commands work as well as Display them in running config; * Add "no" version of several commands; * Fix a serious momory leaks; * Fix segfault when there is no 'successor' route to a Given prefix; * Other minor corrections; Signed-off-by: Renato Westphal <renatowestphal@gmail.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-13eigrpd: Some Basic CorrectionsRenato Westphal
* Advertise routes to zebra * Connected routes should not have a nexthop address * Fix segfaut on exit Signed-off-by: Renato Westphal <renatowestphal@gmail.com>
2017-04-26eigrpd: Switch u_int64_t -> uint64_tDonald Sharp
Apparently u_int64_t is not available (or we don't pull the right headers in for solaris based systems ). Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-08eigrpd: Cleanup tab/spacing of the *.c filesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>