diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2025-03-27 09:03:52 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2025-03-27 11:28:58 -0400 |
| commit | 694fb7f48fb19fe22b42b651d58876833e461d94 (patch) | |
| tree | b927f405855266955b75eab7a62692c8a49da446 /eigrpd | |
| parent | 2de45ca1b4c8a50e2ff8a0ae5fcaad1abce1d2a9 (diff) | |
eigrpd: Fix possible use after free in nbr deletion
Coverity is complaining about use after free's in
clearing eigrp neighbors. Clean the code
up to not have the problem.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'eigrpd')
| -rw-r--r-- | eigrpd/eigrp_vty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c index e68b85d801..1a81a338bb 100644 --- a/eigrpd/eigrp_vty.c +++ b/eigrpd/eigrp_vty.c @@ -333,7 +333,7 @@ DEFPY (clear_ip_eigrp_neighbors, eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL); /* iterate over all neighbors on eigrp interface */ - frr_each (eigrp_nbr_hash, &ei->nbr_hash_head, nbr) { + frr_each_safe (eigrp_nbr_hash, &ei->nbr_hash_head, nbr) { if (nbr->state != EIGRP_NEIGHBOR_DOWN) { zlog_debug( "Neighbor %pI4 (%s) is down: manually cleared", @@ -393,7 +393,7 @@ DEFPY (clear_ip_eigrp_neighbors_int, eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL); /* iterate over all neighbors on eigrp interface */ - frr_each (eigrp_nbr_hash, &ei->nbr_hash_head, nbr) { + frr_each_safe (eigrp_nbr_hash, &ei->nbr_hash_head, nbr) { if (nbr->state != EIGRP_NEIGHBOR_DOWN) { zlog_debug( "Neighbor %pI4 (%s) is down: manually cleared", |
