diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 950d5f359c08..945bd0eb68db 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -532,6 +532,9 @@ static void lsp_update_data(struct isis_lsp *lsp, struct isis_lsp_hdr *hdr, : IS_LEVEL_1); } + _lsp_regenerate_schedule(area, lsp->level, 0, false, __func__, __FILE__, + __LINE__); + return; } @@ -1314,6 +1317,74 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area) metric); } + struct isis_adjacency* adj; + bool flag = false; + for (ALL_LIST_ELEMENTS_RO(area->adjacency_list, node, adj)) { + if (adj->level == IS_LEVEL_2) + flag = true; + } + + if(flag && (lsp->level == IS_LEVEL_2) && (area->is_type == 3) && (lsp->hdr.lsp_bits != LSPBIT_ATT)) { + struct isis_lsp* lsp_tmp_ip; + struct isis_lsp* lsp_tmp_ipv6; + struct lspdb_head *head_tmp_ip = &area->lspdb[0]; + struct lspdb_head *head_tmp_ipv6 = &area->lspdb[0]; + if(head_tmp_ip) { + frr_each (lspdb, head_tmp_ip, lsp_tmp_ip) { + if (strcmp(lsp->tlvs->hostname, lsp_tmp_ip->tlvs->hostname) != 0) { + for (struct isis_item* i = lsp_tmp_ip->tlvs->extended_ip_reach.head; i; i = i->next){ + struct isis_extended_ip_reach *r = (struct isis_extended_ip_reach *)i; + int count = 0; + for (struct isis_item* l = lsp->tlvs->extended_ip_reach.head; l; l = l->next) { + struct isis_extended_ip_reach *rt = (struct isis_extended_ip_reach *)l; + if(r->prefix.prefix.s_addr == rt->prefix.prefix.s_addr) { + if(r->metric > rt->metric) + count++; + break; + } + } + if (count == 0) + lsp_build_internal_reach_ipv4(lsp, area, &r->prefix , r->metric); + } + } + } + } + + if(head_tmp_ipv6) { + frr_each (lspdb, head_tmp_ipv6, lsp_tmp_ipv6) { + if (strcmp(lsp->tlvs->hostname, lsp_tmp_ipv6->tlvs->hostname) != 0) { + for (struct isis_item* i = lsp_tmp_ipv6->tlvs->ipv6_reach.head; i; i = i->next){ + struct isis_ipv6_reach *r = (struct isis_ipv6_reach *)i; + int count = 0; + for (struct isis_item* l = lsp->tlvs->ipv6_reach.head; l; l = l->next) { + struct isis_ipv6_reach *rt = (struct isis_ipv6_reach *)l; + char prefixbuf_1 + [PREFIX2STR_BUFFER]; + char prefixbuf_2 + [PREFIX2STR_BUFFER]; + if (strcmp(prefix2str( + &r->prefix, + prefixbuf_1, + sizeof(prefixbuf_1)), + prefix2str( + &rt->prefix, + prefixbuf_2, + sizeof(prefixbuf_2))) == + 0) { + if(r->metric > rt->metric) + count++; + break; + } + } + if (count == 0) + lsp_build_internal_reach_ipv6(lsp, area, &r->prefix, r->metric); + } + } + } + } + } + + switch (circuit->circ_type) { case CIRCUIT_T_BROADCAST: if (level & circuit->is_type) {