mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 19:26:10 +00:00
Merge pull request #11508 from louis-6wind/lsp-parse
isisd: fix infinite loop when parsing LSPs
This commit is contained in:
commit
c718a13d60
@ -1400,20 +1400,21 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree,
|
|||||||
spf_adj_list_parse_lsp(spftree, adj_list, lsp, id, metric);
|
spf_adj_list_parse_lsp(spftree, adj_list, lsp, id, metric);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void spf_adj_list_parse_lsp_frag(struct isis_spftree *spftree,
|
static void spf_adj_list_parse_lsp(struct isis_spftree *spftree,
|
||||||
struct list *adj_list,
|
struct list *adj_list, struct isis_lsp *lsp,
|
||||||
struct isis_lsp *lsp,
|
const uint8_t *pseudo_nodeid,
|
||||||
const uint8_t *pseudo_nodeid,
|
uint32_t pseudo_metric)
|
||||||
uint32_t pseudo_metric)
|
|
||||||
{
|
{
|
||||||
bool pseudo_lsp = LSP_PSEUDO_ID(lsp->hdr.lsp_id);
|
bool pseudo_lsp = LSP_PSEUDO_ID(lsp->hdr.lsp_id);
|
||||||
|
struct isis_lsp *frag;
|
||||||
|
struct listnode *node;
|
||||||
struct isis_item *head;
|
struct isis_item *head;
|
||||||
struct isis_item_list *te_neighs;
|
struct isis_item_list *te_neighs;
|
||||||
|
|
||||||
if (lsp->hdr.seqno == 0 || lsp->hdr.rem_lifetime == 0)
|
if (lsp->hdr.seqno == 0 || lsp->hdr.rem_lifetime == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Parse main LSP. */
|
/* Parse LSP. */
|
||||||
if (lsp->tlvs) {
|
if (lsp->tlvs) {
|
||||||
if (pseudo_lsp || spftree->mtid == ISIS_MT_IPV4_UNICAST) {
|
if (pseudo_lsp || spftree->mtid == ISIS_MT_IPV4_UNICAST) {
|
||||||
head = lsp->tlvs->oldstyle_reach.head;
|
head = lsp->tlvs->oldstyle_reach.head;
|
||||||
@ -1444,27 +1445,17 @@ static void spf_adj_list_parse_lsp_frag(struct isis_spftree *spftree,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (LSP_FRAGMENT(lsp->hdr.lsp_id))
|
||||||
static void spf_adj_list_parse_lsp(struct isis_spftree *spftree,
|
return;
|
||||||
struct list *adj_list, struct isis_lsp *lsp,
|
|
||||||
const uint8_t *pseudo_nodeid,
|
|
||||||
uint32_t pseudo_metric)
|
|
||||||
{
|
|
||||||
struct isis_lsp *frag;
|
|
||||||
struct listnode *node;
|
|
||||||
|
|
||||||
spf_adj_list_parse_lsp_frag(spftree, adj_list, lsp, pseudo_nodeid,
|
|
||||||
pseudo_metric);
|
|
||||||
|
|
||||||
/* Parse LSP fragments. */
|
/* Parse LSP fragments. */
|
||||||
for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
|
for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
|
||||||
if (!frag->tlvs)
|
if (!frag->tlvs)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
spf_adj_list_parse_lsp_frag(spftree, adj_list, frag,
|
spf_adj_list_parse_lsp(spftree, adj_list, frag, pseudo_nodeid,
|
||||||
pseudo_nodeid, pseudo_metric);
|
pseudo_metric);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user