Merge pull request #18525 from donaldsharp/eigrp_coverity_newly_found

eigrpd: Fix possible use after free in nbr deletion
This commit is contained in:
Jafar Al-Gharaibeh 2025-04-02 14:13:37 -05:00 committed by GitHub
commit 994fdeeb22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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",