Skip to content

Commit

Permalink
Merge pull request FRRouting#7474 from eololab/fix-crash-skiplist-debug
Browse files Browse the repository at this point in the history
lib, bgpd: fix crash using skiplist debug function
  • Loading branch information
Mark Stapp authored Nov 13, 2020
2 parents a6aa46c + bcbc2aa commit 15675d0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/skiplist.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ DEFINE_MTYPE_STATIC(LIB, SKIP_LIST_NODE, "Skip Node")

static int randomsLeft;
static int randomBits;
static struct skiplist *skiplist_last_created; /* debugging hack */

#if 1
#define CHECKLAST(sl) \
Expand Down Expand Up @@ -150,8 +149,6 @@ struct skiplist *skiplist_new(int flags,
if (del)
new->del = del;

skiplist_last_created = new; /* debug */

return new;
}

Expand Down Expand Up @@ -586,7 +583,8 @@ void skiplist_debug(struct vty *vty, struct skiplist *l)
int i;

if (!l)
l = skiplist_last_created;
return;

vty_out(vty, "Skiplist %p has max level %d\n", l, l->level);
for (i = l->level; i >= 0; --i)
vty_out(vty, " @%d: %ld\n", i,
Expand Down

0 comments on commit 15675d0

Please sign in to comment.