diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2025-03-24 08:07:02 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2025-03-24 11:36:13 -0400 |
| commit | efb2aeae7b0d565f919bcd77345b78a9bd91e297 (patch) | |
| tree | 2936d4d76bd210d0ac2de7dcc3c3c4397bf6f0bc /eigrpd/eigrp_network.c | |
| parent | 95e7f56eec5797a9e6d46d91441d611592b952cf (diff) | |
eigrpd: Cleanup memory issues on shutdown
a) EIGRP was having issues with the prefix created as part
of the topology destination. Make this just a part of the
topology data structure instead of allocating it.
b) EIGRP was not freeing up any memory associated with
the network table. Free it.
c) EIGRP was confusing zebra shutdown as part of the deletion
of the last eigrp data structure. This was inappropriate it
should be part of the `I'm just shutting down`.
d) The QOBJ was not being properly freed, free it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'eigrpd/eigrp_network.c')
| -rw-r--r-- | eigrpd/eigrp_network.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/eigrpd/eigrp_network.c b/eigrpd/eigrp_network.c index 910215cbcb..fc334cf97d 100644 --- a/eigrpd/eigrp_network.c +++ b/eigrpd/eigrp_network.c @@ -219,6 +219,21 @@ int eigrp_network_set(struct eigrp *eigrp, struct prefix *p) return 1; } +static void eigrp_network_delete_all(struct eigrp *eigrp, struct route_table *table) +{ + struct route_node *rn; + + for (rn = route_top(table); rn; rn = route_next(rn)) { + prefix_free((struct prefix **)&rn->info); + } +} + +void eigrp_network_free(struct eigrp *eigrp, struct route_table *table) +{ + eigrp_network_delete_all(eigrp, table); + route_table_finish(table); +} + /* Check whether interface matches given network * returns: 1, true. 0, false */ |
