summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--isisd/isis_te.c15
-rw-r--r--sharpd/sharp_zebra.c2
2 files changed, 15 insertions, 2 deletions
diff --git a/isisd/isis_te.c b/isisd/isis_te.c
index 45d763fd69..c0b5f35f47 100644
--- a/isisd/isis_te.c
+++ b/isisd/isis_te.c
@@ -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;
}
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 17ad705969..91fb7f03b1 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -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],