diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2025-02-12 22:28:24 -0600 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 22:28:24 -0600 | 
| commit | d85c28e8f11d628bcca73919c21d362bbbee5830 (patch) | |
| tree | dc2cbf350947c65f4a1c0d278bd949735b4f27df | |
| parent | 30c21862fd5d33c3b2ee19749d372c770c9e0b28 (diff) | |
| parent | 6f87c8f989215e48dddccfbd685e99cfc31ae3a8 (diff) | |
Merge pull request #18057 from FRRouting/mergify/bp/stable/10.2/pr-18048
pimd: fix DR election race on startup (backport #18048)
| -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;  	}  | 
