Skip to content
Permalink
Browse files

isisd: Fix lsp_build_list_nonzero_ht

When `first` would be initialized to the same value as `last`, the
function would return incorrect results.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
  • Loading branch information...
cfra committed Nov 10, 2018
1 parent 3759776 commit 9337256ebf9e562d30bd03bfa02e37f3158b5ef6
Showing with 8 additions and 20 deletions.
  1. +8 −20 isisd/isis_lsp.c
@@ -578,29 +578,17 @@ void lsp_insert(struct isis_lsp *lsp, dict_t *lspdb)
void lsp_build_list_nonzero_ht(uint8_t *start_id, uint8_t *stop_id,
struct list *list, dict_t *lspdb)
{
dnode_t *first, *last, *curr;
for (dnode_t *curr = dict_lower_bound(lspdb, start_id);
curr; curr = dict_next(lspdb, curr)) {
struct isis_lsp *lsp = curr->dict_data;

first = dict_lower_bound(lspdb, start_id);
if (!first)
return;

last = dict_upper_bound(lspdb, stop_id);

curr = first;

if (((struct isis_lsp *)(curr->dict_data))->hdr.rem_lifetime)
listnode_add(list, first->dict_data);

while (curr) {
curr = dict_next(lspdb, curr);
if (curr
&& ((struct isis_lsp *)(curr->dict_data))->hdr.rem_lifetime)
listnode_add(list, curr->dict_data);
if (curr == last)
if (memcmp(lsp->hdr.lsp_id, stop_id,
ISIS_SYS_ID_LEN + 2) > 0)
break;
}

return;
if (lsp->hdr.rem_lifetime)
listnode_add(list, lsp);
}
}

static void lsp_set_time(struct isis_lsp *lsp)

0 comments on commit 9337256

Please sign in to comment.
You can’t perform that action at this time.