Merge pull request #16241 from zhou-run/202406191740

isisd: The neighbor entry still displays the deleted hostname of the neighbor.
This commit is contained in:
Russ White 2024-07-09 11:40:26 -04:00 committed by GitHub
commit 685712df44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 8 deletions

View File

@ -293,7 +293,7 @@ const char *isis_adj_name(const struct isis_adjacency *adj)
struct isis_dynhn *dyn; struct isis_dynhn *dyn;
dyn = dynhn_find_by_id(adj->circuit->isis, adj->sysid); dyn = dynhn_find_by_id(adj->circuit->isis, adj->sysid);
if (dyn) if (adj->circuit->area->dynhostname && dyn)
return dyn->hostname; return dyn->hostname;
snprintfrr(buf, sizeof(buf), "%pSY", adj->sysid); snprintfrr(buf, sizeof(buf), "%pSY", adj->sysid);

View File

@ -482,13 +482,19 @@ static void lsp_update_data(struct isis_lsp *lsp, struct isis_lsp_hdr *hdr,
lsp->tlvs = tlvs; lsp->tlvs = tlvs;
if (area->dynhostname && lsp->tlvs->hostname if (area->dynhostname && lsp->hdr.rem_lifetime) {
&& lsp->hdr.rem_lifetime) { if (lsp->tlvs->hostname) {
isis_dynhn_insert( isis_dynhn_insert(area->isis, lsp->hdr.lsp_id,
area->isis, lsp->hdr.lsp_id, lsp->tlvs->hostname, lsp->tlvs->hostname,
(lsp->hdr.lsp_bits & LSPBIT_IST) == IS_LEVEL_1_AND_2 (lsp->hdr.lsp_bits & LSPBIT_IST) ==
? IS_LEVEL_2 IS_LEVEL_1_AND_2
: IS_LEVEL_1); ? IS_LEVEL_2
: IS_LEVEL_1);
} else {
if (!LSP_PSEUDO_ID(lsp->hdr.lsp_id) &&
!LSP_FRAGMENT(lsp->hdr.lsp_id))
isis_dynhn_remove(area->isis, lsp->hdr.lsp_id);
}
} }
return; return;
@ -2220,6 +2226,10 @@ void lsp_tick(struct event *thread)
&area->lspdb[level], &area->lspdb[level],
next); next);
if (!LSP_PSEUDO_ID(lsp->hdr.lsp_id))
isis_dynhn_remove(area->isis,
lsp->hdr.lsp_id);
lspdb_del(&area->lspdb[level], lsp); lspdb_del(&area->lspdb[level], lsp);
lsp_destroy(lsp); lsp_destroy(lsp);
lsp = NULL; lsp = NULL;

View File

@ -679,6 +679,9 @@ def _check_lsp_overload_bit(router, overloaded_router_lsp, att_p_ol_expected):
) )
database_json = json.loads(isis_database_output) database_json = json.loads(isis_database_output)
if "lsps" not in database_json["areas"][0]["levels"][1]:
return "The LSP of {} has not been synchronized yet ".format(router.name)
att_p_ol = database_json["areas"][0]["levels"][1]["lsps"][0]["attPOl"] att_p_ol = database_json["areas"][0]["levels"][1]["lsps"][0]["attPOl"]
if att_p_ol == att_p_ol_expected: if att_p_ol == att_p_ol_expected:
return True return True