Fixes bug in protocol state machine
Scheduling flush must be done before resource pool freeing as it frees some allocated list nodes from a global list.
This commit is contained in:
parent
80ac7dc181
commit
b807ef9a15
1 changed files with 3 additions and 3 deletions
|
@ -605,6 +605,9 @@ proto_notify_state(struct proto *p, unsigned ps)
|
||||||
switch (ps)
|
switch (ps)
|
||||||
{
|
{
|
||||||
case PS_DOWN:
|
case PS_DOWN:
|
||||||
|
if ((cs = FS_FEEDING) || (cs == FS_HAPPY))
|
||||||
|
proto_schedule_flush(p);
|
||||||
|
|
||||||
neigh_prune(); // FIXME convert neighbors to resource?
|
neigh_prune(); // FIXME convert neighbors to resource?
|
||||||
rfree(p->pool);
|
rfree(p->pool);
|
||||||
p->pool = NULL;
|
p->pool = NULL;
|
||||||
|
@ -614,9 +617,6 @@ proto_notify_state(struct proto *p, unsigned ps)
|
||||||
proto_fell_down(p);
|
proto_fell_down(p);
|
||||||
return; /* The protocol might have ceased to exist */
|
return; /* The protocol might have ceased to exist */
|
||||||
}
|
}
|
||||||
/* Otherwise, we have something to flush... */
|
|
||||||
else if (cs != FS_FLUSHING)
|
|
||||||
proto_schedule_flush(p);
|
|
||||||
break;
|
break;
|
||||||
case PS_START:
|
case PS_START:
|
||||||
ASSERT(ops == PS_DOWN);
|
ASSERT(ops == PS_DOWN);
|
||||||
|
|
Loading…
Reference in a new issue