Merge pull request #13161 from Orange-OpenSource/isis_te

isisd: Correction of subnets creation in the TED
This commit is contained in:
Donald Sharp 2023-03-31 07:48:26 -04:00 committed by GitHub
commit 13ab57d98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -1075,9 +1075,21 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric,
}
if (!std)
prefix_copy(&p, prefix);
else
else {
/* Remove old subnet if any before prefix adjustment */
subnet = ls_find_subnet(args->ted, *prefix);
if (subnet) {
if (args->export) {
subnet->status = DELETE;
isis_te_export(LS_MSG_TYPE_PREFIX, subnet);
}
te_debug(" |- Remove subnet with prefix %pFX",
&subnet->key);
ls_subnet_del_all(args->ted, subnet);
}
te_debug(" |- Adjust prefix %pFX with local address to: %pFX",
prefix, &p);
}
/* Search existing Subnet in TED ... */
subnet = ls_find_subnet(args->ted, p);
@ -1085,6 +1097,7 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric,
if (!subnet) {
ls_pref = ls_prefix_new(vertex->node->adv, p);
subnet = ls_subnet_add(args->ted, ls_pref);
/* Stop processing if we are unable to create a new subnet */
if (!subnet)
return LSP_ITER_CONTINUE;
}

View File

@ -790,7 +790,7 @@ static int sharp_opaque_handler(ZAPI_CALLBACK_ARGS)
zclient->session_id, info.type);
if (info.type == LINK_STATE_UPDATE) {
lse = ls_stream2ted(sg.ted, s, false);
lse = ls_stream2ted(sg.ted, s, true);
if (lse) {
zlog_debug(" |- Got %s %s from Link State Database",
status2txt[lse->status],