Merge pull request #18057 from FRRouting/mergify/bp/stable/10.2/pr-18048

pimd: fix DR election race on startup (backport #18048)
This commit is contained in:
Jafar Al-Gharaibeh 2025-02-12 22:28:24 -06:00 committed by GitHub
commit d85c28e8f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1755,6 +1755,11 @@ int lib_interface_pim_address_family_pim_enable_modify(struct nb_cb_modify_args
ifp->name);
return NB_ERR_INCONSISTENCY;
}
/* Trigger election in case it was never run before */
pim_ifp = ifp->info;
if (pim_addr_is_any(pim_ifp->pim_dr_addr))
pim_if_dr_election(ifp);
} else {
pim_ifp = ifp->info;
if (!pim_ifp)
@ -1788,6 +1793,10 @@ int lib_interface_pim_address_family_pim_passive_enable_modify(
pim_ifp = ifp->info;
pim_ifp->pim_passive_enable =
yang_dnode_get_bool(args->dnode, NULL);
/* Trigger election in case it was never run before */
if (pim_ifp->pim_passive_enable && pim_addr_is_any(pim_ifp->pim_dr_addr))
pim_if_dr_election(ifp);
break;
}