diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2025-02-06 19:28:50 -0300 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2025-02-07 03:42:37 +0000 |
| commit | 6f87c8f989215e48dddccfbd685e99cfc31ae3a8 (patch) | |
| tree | d27b2f4027ee7be7b86cfcef462ba21cad38b2fd /pimd | |
| parent | fc4e1364721c38daaf4c836a1365985d1cdf4010 (diff) | |
pimd: fix DR election race on startup
In case interface address is learnt during configuration, make sure to
run DR election when configuring PIM/PIM passive on interface.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 86445246062583197d4a6dff7b8c74003cd8049d)
Diffstat (limited to 'pimd')
| -rw-r--r-- | pimd/pim_nb_config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 637780ca0f..9a5f6f2de9 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -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; } |
