forked from Mirror/frr
lib: Fix race condition in shutdown of routemap
When shutting down a daemon that uses an update
timer to handle route map processing, there
exists a race condition where if you change
a route map and then immediately shutdown
quagga before the update timer for the routemap
runs, you will be placed in a infinite loop.
This condition happens because this commit introduces
route map memory free'ing but never tests to see
if the to_be_processed flag has happened or not
before deleting:
commit 289d25016b
Author: Lou Berger <lberger@labn.net>
Date: Wed Apr 10 12:30:04 2013 -0700
bgpd, lib: memory cleanups for valgrind, plus debug changes
Modify route_map_finish to explicitly turn off the to_be_processed
field. As that we know we are going away if route_map_finish is
called.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
parent
882261e18b
commit
b09bceec68
|
@ -1838,7 +1838,11 @@ route_map_finish (void)
|
||||||
|
|
||||||
/* cleanup route_map */
|
/* cleanup route_map */
|
||||||
while (route_map_master.head)
|
while (route_map_master.head)
|
||||||
route_map_delete (route_map_master.head);
|
{
|
||||||
|
struct route_map *map = route_map_master.head;
|
||||||
|
map->to_be_processed = 0;
|
||||||
|
route_map_delete (map);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 1; i < ROUTE_MAP_DEP_MAX; i++)
|
for (i = 1; i < ROUTE_MAP_DEP_MAX; i++)
|
||||||
hash_free(route_map_dep_hash[i]);
|
hash_free(route_map_dep_hash[i]);
|
||||||
|
|
Loading…
Reference in a new issue