takeover: prevent crash by avoiding free in traverse on RST timeout
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 26 Jul 2010 04:28:48 +0000 (13:58 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 18 Aug 2010 02:10:17 +0000 (11:40 +0930)
commit08f7f85477610a4916c1ec866aa467b28f1bbec3
tree26663b6b7f2e25fdf9d10125fa28efcf8b4cbfbf
parentaeb70c7e7822854eb87873a5c7783e27e6e72318
takeover: prevent crash by avoiding free in traverse on RST timeout

After 5 attempts to send a RST to a client without any response, we free
"con"; this is done during a traverse.  This frees the node we are walking
through (the node is made a child of "con" down in rb_tree.c's
trbt_create_node() (Valgrind would catch this, as Martin confirmed).

So, we create a temporary parent and reparent onto that; then we free
that parent after the traverse, thus deleting the unwanted nodes.

CQ:S1019041
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
server/ctdb_takeover.c