summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrpd.c
diff options
context:
space:
mode:
authorRenato Westphal <renatowestphal@gmail.com>2017-04-27 19:55:23 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-05-13 19:08:00 +0200
commit63863c4797d0f41f5369b37285de78259b38742f (patch)
tree818d851f08e56571dc26a938a6c9f76fda46bf97 /eigrpd/eigrpd.c
parenteigrpd: Some Basic Corrections (diff)
downloadfrr-63863c4797d0f41f5369b37285de78259b38742f.tar.xz
frr-63863c4797d0f41f5369b37285de78259b38742f.zip
eigrpd: Diverse Fixes
* 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>
Diffstat (limited to 'eigrpd/eigrpd.c')
-rw-r--r--eigrpd/eigrpd.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/eigrpd/eigrpd.c b/eigrpd/eigrpd.c
index c6af8986b..6c0033481 100644
--- a/eigrpd/eigrpd.c
+++ b/eigrpd/eigrpd.c
@@ -61,7 +61,6 @@ static struct eigrp_master eigrp_master;
struct eigrp_master *eigrp_om;
-static void eigrp_finish_final(struct eigrp *);
static void eigrp_delete(struct eigrp *);
static struct eigrp *eigrp_new(const char *);
static void eigrp_add(struct eigrp *);
@@ -262,26 +261,39 @@ eigrp_terminate (void)
void
eigrp_finish (struct eigrp *eigrp)
{
-
eigrp_finish_final(eigrp);
/* eigrp being shut-down? If so, was this the last eigrp instance? */
if (CHECK_FLAG(eigrp_om->options, EIGRP_MASTER_SHUTDOWN)
&& (listcount(eigrp_om->eigrp) == 0))
- exit(0);
+ {
+ if (zclient)
+ zclient_free (zclient);
+
+ exit(0);
+ }
return;
}
/* Final cleanup of eigrp instance */
-static void
+void
eigrp_finish_final (struct eigrp *eigrp)
{
+ struct eigrp_interface *ei;
+ struct eigrp_neighbor *nbr;
+ struct listnode *node, *nnode, *node2, *nnode2;
- close(eigrp->fd);
+ for (ALL_LIST_ELEMENTS (eigrp->eiflist, node, nnode, ei))
+ {
+ for (ALL_LIST_ELEMENTS (ei->nbrs, node2, nnode2, nbr))
+ eigrp_nbr_delete (nbr);
+ eigrp_if_free (ei, INTERFACE_DOWN_BY_FINAL);
+ }
- if (zclient)
- zclient_free(zclient);
+ THREAD_OFF (eigrp->t_write);
+ THREAD_OFF (eigrp->t_read);
+ close (eigrp->fd);
list_delete(eigrp->eiflist);
list_delete(eigrp->oi_write_q);