mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 01:14:48 +00:00
isisd: store LSPs associated to all SPF adjacencies
Instead of storing the LSP associated to pseudonodes only, store the LSP associated to all SPF adjacencies instead. The upcoming LFA work will need to have that piece of information for all SPF adjacencies in order to know which ones have the overload bit set or not. Other use cases might arise in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
d20b14bcd7
commit
2d560b3d6d
@ -1158,9 +1158,9 @@ static void isis_spf_preload_tent(struct isis_spftree *spftree,
|
||||
: VTYPE_NONPSEUDO_TE_IS,
|
||||
sadj->id, sadj, metric, NULL,
|
||||
parent);
|
||||
} else if (sadj->lan.lsp_pseudo) {
|
||||
isis_spf_process_lsp(spftree, sadj->lan.lsp_pseudo,
|
||||
metric, 0, spftree->sysid, parent);
|
||||
} else if (sadj->lsp) {
|
||||
isis_spf_process_lsp(spftree, sadj->lsp, metric, 0,
|
||||
spftree->sysid, parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1243,12 +1243,24 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree,
|
||||
struct isis_ext_subtlvs *subtlvs)
|
||||
{
|
||||
struct isis_spf_adj *sadj;
|
||||
uint8_t lspid[ISIS_SYS_ID_LEN + 2];
|
||||
struct isis_lsp *lsp;
|
||||
uint8_t flags = 0;
|
||||
|
||||
/* Skip self in the pseudonode. */
|
||||
if (desig_is_id && !memcmp(id, spftree->sysid, ISIS_SYS_ID_LEN))
|
||||
return;
|
||||
|
||||
/* Find LSP from the adjacency. */
|
||||
memcpy(lspid, id, ISIS_SYS_ID_LEN + 1);
|
||||
LSP_FRAGMENT(lspid) = 0;
|
||||
lsp = lsp_search(spftree->lspdb, lspid);
|
||||
if (lsp == NULL || lsp->hdr.rem_lifetime == 0) {
|
||||
zlog_warn("ISIS-SPF: No LSP found from root to L%d %s",
|
||||
spftree->level, rawlspid_print(id));
|
||||
return;
|
||||
}
|
||||
|
||||
sadj = XCALLOC(MTYPE_ISIS_SPF_ADJ, sizeof(*sadj));
|
||||
memcpy(sadj->id, id, sizeof(sadj->id));
|
||||
if (desig_is_id) {
|
||||
@ -1260,6 +1272,7 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree,
|
||||
sadj->metric = metric;
|
||||
if (oldmetric)
|
||||
SET_FLAG(flags, F_ISIS_SPF_ADJ_OLDMETRIC);
|
||||
sadj->lsp = lsp;
|
||||
sadj->subtlvs = subtlvs;
|
||||
sadj->flags = flags;
|
||||
|
||||
@ -1294,24 +1307,8 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree,
|
||||
}
|
||||
|
||||
/* Parse pseudonode LSP too. */
|
||||
if (LSP_PSEUDO_ID(id)) {
|
||||
uint8_t lspid[ISIS_SYS_ID_LEN + 2];
|
||||
struct isis_lsp *lsp_pseudo;
|
||||
|
||||
memcpy(lspid, id, ISIS_SYS_ID_LEN + 1);
|
||||
LSP_FRAGMENT(lspid) = 0;
|
||||
lsp_pseudo = lsp_search(spftree->lspdb, lspid);
|
||||
if (lsp_pseudo == NULL || lsp_pseudo->hdr.rem_lifetime == 0) {
|
||||
zlog_warn(
|
||||
"ISIS-SPF: No LSP found from root to L%d DR %s",
|
||||
spftree->level, rawlspid_print(id));
|
||||
return;
|
||||
}
|
||||
|
||||
sadj->lan.lsp_pseudo = lsp_pseudo;
|
||||
spf_adj_list_parse_lsp(spftree, adj_list, lsp_pseudo, id,
|
||||
metric);
|
||||
}
|
||||
if (LSP_PSEUDO_ID(id))
|
||||
spf_adj_list_parse_lsp(spftree, adj_list, lsp, id, metric);
|
||||
}
|
||||
|
||||
static void spf_adj_list_parse_lsp(struct isis_spftree *spftree,
|
||||
|
@ -39,9 +39,9 @@ struct isis_spf_adj {
|
||||
struct isis_adjacency *adj;
|
||||
uint32_t metric;
|
||||
struct isis_ext_subtlvs *subtlvs;
|
||||
struct isis_lsp *lsp;
|
||||
struct {
|
||||
uint8_t desig_is_id[ISIS_SYS_ID_LEN + 1];
|
||||
struct isis_lsp *lsp_pseudo;
|
||||
} lan;
|
||||
uint8_t flags;
|
||||
#define F_ISIS_SPF_ADJ_BROADCAST 0x01
|
||||
|
Loading…
Reference in New Issue
Block a user