mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Fixes some BFD bugs and makes logging thread-safe.
This commit is contained in:
@@ -132,3 +132,37 @@ same_tree(struct f_tree *t1, struct f_tree *t2)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
tree_node_format(struct f_tree *t, buffer *buf)
|
||||
{
|
||||
if (t == NULL)
|
||||
return;
|
||||
|
||||
tree_node_format(t->left, buf);
|
||||
|
||||
val_format(t->from, buf);
|
||||
if (val_compare(t->from, t->to) != 0)
|
||||
{
|
||||
buffer_puts(buf, "..");
|
||||
val_format(t->to, buf);
|
||||
}
|
||||
buffer_puts(buf, ", ");
|
||||
|
||||
tree_node_format(t->right, buf);
|
||||
}
|
||||
|
||||
void
|
||||
tree_format(struct f_tree *t, buffer *buf)
|
||||
{
|
||||
buffer_puts(buf, "[");
|
||||
|
||||
tree_node_format(t, buf);
|
||||
|
||||
/* Undo last separator */
|
||||
if (buf->pos[-1] != '[')
|
||||
buf->pos -= 2;
|
||||
|
||||
buffer_puts(buf, "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user