Commit a4b219c5 authored by Alessandro Rubini's avatar Alessandro Rubini

fsm: if the state is changed, enter it immediately

If the state just executed switched to a new state, we should enter
that new stat immediately, and ignore ppi->next_delay.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7c7de71f
......@@ -49,10 +49,11 @@ int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen)
ppi->is_new_state = 0;
/* done: accept next state and delay */
/* done: if new state mark it, and enter it now (0 ms) */
if (ppi->state != ppi->next_state) {
ppi->state = ppi->next_state;
ppi->is_new_state = 1;
return 0;
}
return ppi->next_delay;
}
......
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