• Alessandro Rubini's avatar
    fsm.c: bugfix, exposed by link down/up in wr-switch · 6d351515
    Alessandro Rubini authored
    Commit d2b2c636 introduced a caching of the current state structure.
    The "current" structure, as long as not null, is considered valid.
    arch-wrs, just sets ppi->state to initializing on link-up, without
    clearing the cached pointer, so fsm.c was using the old pointer,
    resulting in use of closed file descriptors, as no init was performed.
    
    This doesn't apply to change from withing the states themselves, as
    fsm.c manages the state change.
    
    As a side effect, now that we check the state numberm there's no need
    to zero the pointer on state leave. (And while a it another trivial detail...).
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    6d351515
fsm.c 6.29 KB