Commit 86fdf30c authored by Maciej Lipinski's avatar Maciej Lipinski Committed by Alessandro Rubini

bmc: bugfix, calculate compres before using

Port configured to PPSI_ROLE_MASTER must do m1() update of data set
only if it is a port of a GM. We need the dataSet comparision to
know this (thus we calculate the compres value) even on the ports
forced to be masters by default
parent 7c62f416
......@@ -192,9 +192,6 @@ static int bmc_state_decision(struct pp_instance *ppi,
int cmpres;
struct pp_frgn_master myself;
if (ppi->role == PPSI_ROLE_MASTER)
goto master;
if (ppi->role == PPSI_ROLE_SLAVE)
goto slave;
......@@ -207,6 +204,9 @@ static int bmc_state_decision(struct pp_instance *ppi,
/* dataset_cmp is "a - b" but lower values win */
cmpres = bmc_dataset_cmp(ppi, &myself, m);
if (ppi->role == PPSI_ROLE_MASTER)
goto master;
if (DSDEF(ppi)->clockQuality.clockClass < 128) {
if (cmpres < 0)
goto master;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment