Commit eb3f2f2637 for frr

commit eb3f2f2637da2da4d9e6bfbbca65c4a0e4f178e8
Author: Lincoln Thurlow <lincoln@isi.edu>
Date:   Tue Dec 1 11:00:46 2026 -0800

    pathd: clean up the paths of a removed PCE

    The paths a PCE initiated stay when the PCE is removed from the
    configuration.

    pcep_thread_event_remove_pcc_by_id() frees the PCC state, and its
    session timeout with it, without cleaning up.

    This commit runs the session timeout cleanup of a PCE when it is
    removed from the configuration.

    Signed-off-by: Lincoln Thurlow <lincoln@isi.edu>

diff --git a/pathd/path_pcep_controller.c b/pathd/path_pcep_controller.c
index 7cfb7c0ba8..8691e4e898 100644
--- a/pathd/path_pcep_controller.c
+++ b/pathd/path_pcep_controller.c
@@ -939,6 +939,8 @@ int pcep_thread_event_remove_pcc_by_id(struct ctrl_state *ctrl_state,
 		struct pcc_state *pcc_state =
 			pcep_pcc_get_pcc_by_id(ctrl_state->pcc, pcc_id);
 		if (pcc_state) {
+			/* A removed PCE has no session timeout left to clean up */
+			pcep_thread_remove_candidate_path_segments(ctrl_state, pcc_state);
 			remove_pcc_state(ctrl_state, pcc_state);
 			pcep_pcc_finalize(ctrl_state, pcc_state);
 		}