mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 16:48:43 +00:00
Fixes race condition leading to memory corruption and crash.
When protocol started, feeding was scheduled. If protocol got down before feeding was executed, then function responsible for connecting protocol to kernel routing tables was called after the function responsible for disconnecting, then resource pool of protocol was freed, but freed linked list structures remains in the list.
This commit is contained in:
parent
35f983f889
commit
fbde6c3908
@ -521,9 +521,10 @@ proto_feed_more(void *P)
|
|||||||
{
|
{
|
||||||
struct proto *p = P;
|
struct proto *p = P;
|
||||||
|
|
||||||
DBG("Feeding protocol %s continued\n", p->name);
|
|
||||||
if (p->core_state != FS_FEEDING)
|
if (p->core_state != FS_FEEDING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
DBG("Feeding protocol %s continued\n", p->name);
|
||||||
if (rt_feed_baby(p))
|
if (rt_feed_baby(p))
|
||||||
{
|
{
|
||||||
p->core_state = FS_HAPPY;
|
p->core_state = FS_HAPPY;
|
||||||
@ -542,6 +543,9 @@ proto_feed(void *P)
|
|||||||
{
|
{
|
||||||
struct proto *p = P;
|
struct proto *p = P;
|
||||||
|
|
||||||
|
if (p->core_state != FS_FEEDING)
|
||||||
|
return;
|
||||||
|
|
||||||
DBG("Feeding protocol %s\n", p->name);
|
DBG("Feeding protocol %s\n", p->name);
|
||||||
proto_add_announce_hook(p, p->table);
|
proto_add_announce_hook(p, p->table);
|
||||||
if_feed_baby(p);
|
if_feed_baby(p);
|
||||||
|
Loading…
Reference in New Issue
Block a user