Skip to content

Commit

Permalink
added adding prefixes from L1 toL 2 on L1L2 router
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashhkaa committed Oct 6, 2023
1 parent 9e32b73 commit 7c2ea45
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions isisd/isis_lsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,52 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
metric);
}

if((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(prefix_same((struct prefix_ipv4*)&r->prefix,(struct prefix_ipv6*)&rt->prefix)){
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;
if(prefix_same((struct prefix_ipv6*)&r->prefix,(struct prefix_ipv6*)&rt->prefix)){
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) {
Expand Down

0 comments on commit 7c2ea45

Please sign in to comment.