Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isisd: added l1 to l2 distibution #14610

Merged
merged 0 commits into from
Apr 27, 2024
Merged

Conversation

Sashhkaa
Copy link
Contributor

added adding prefixes with the best metric from the level-1 db to the level-2 db on l1_l2 end system

Signed-off-by: Sososhas [email protected]

@frrbot frrbot bot added the isis label Oct 17, 2023
@ton31337
Copy link
Member

Please check frrbot (Github check) failures.

Copy link
Member

@odd22 odd22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code need some review. In addition, the code is not correctly indented. Please have a look to automatic check style result.

isisd/isis_lsp.c Outdated
Comment on lines 535 to 537
_lsp_regenerate_schedule(area, lsp->level, 0, false, __func__, __FILE__,
__LINE__);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not use the _lsp_regenerate_schedule() function but instead the lsp_regenerate_schedule() macro. Please have a look to existing call to this function.

isisd/isis_lsp.c Outdated
Comment on lines 1330 to 1331
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];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use same variables for both IP and IPv6. There are temporary pointer and there is no reason to duplicate them.

@github-actions github-actions bot added size/L and removed size/M labels Oct 19, 2023
@github-actions github-actions bot added size/M and removed size/L labels Oct 19, 2023
@Sashhkaa Sashhkaa force-pushed the multiarea_isis branch 3 times, most recently from fcfbe69 to eb4217b Compare October 23, 2023 13:05
@Sashhkaa Sashhkaa requested a review from odd22 October 23, 2023 13:13
@Sashhkaa Sashhkaa force-pushed the multiarea_isis branch 3 times, most recently from 79b41ad to c15c161 Compare October 24, 2023 09:37
@github-actions github-actions bot added size/XL and removed size/M labels Oct 24, 2023
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks okay ... waiting on other review comments

@Sashhkaa Sashhkaa force-pushed the multiarea_isis branch 2 times, most recently from 6d25240 to be16d01 Compare October 24, 2023 11:58
@github-actions github-actions bot added size/L and removed size/XL labels Oct 24, 2023
@github-actions github-actions bot added size/M and removed size/L labels Oct 24, 2023
@Sashhkaa Sashhkaa force-pushed the multiarea_isis branch 7 times, most recently from 74c32fe to 252fdb4 Compare October 26, 2023 03:09
@github-actions github-actions bot added size/L and removed size/M labels Oct 26, 2023
@github-actions github-actions bot added size/M and removed size/L labels Oct 26, 2023
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good ... waiting on other reviewers

Copy link
Member

@odd22 odd22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iteration functions over IP extended reachability should be rewritten.
All new functions should be declared as static and not publish through isis_lsp.h if there are not used in another file

isisd/isis_lsp.h Outdated
Comment on lines 85 to 91
void iteration_in_lspdb(struct isis_area *area, struct isis_lsp *lsp);
void adding_new_prefix(struct isis_area *area, struct isis_lsp *lsp,
struct isis_lsp *lsp_tmp);
void iteration_in_lsp_ip(struct isis_extended_ip_reach *i, struct isis_lsp *lsp,
int *count);
void iteration_in_lsp_ipv6(struct isis_ipv6_reach *i, struct isis_lsp *lsp,
int *count);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary if these functions are not used outside isis_lsp.c file. You should rather declare the functions as static in isis_lsp.c file

isisd/isis_lsp.c Outdated
@@ -1070,6 +1071,80 @@ static struct isis_lsp *lsp_next_frag(uint8_t frag_num, struct isis_lsp *lsp0,
* Builds the LSP data part. This func creates a new frag whenever
* area->lsp_frag_threshold is exceeded.
*/
void iteration_in_lsp_ip(struct isis_extended_ip_reach *r, struct isis_lsp *lsp,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is preferable to declare a function that return the count instead of void and returning the result with a variable. In particular, in the function, you don't check if the count variable has been allocated or not i.e. if it is not NULL.

isisd/isis_lsp.c Outdated
if (IPV4_ADDR_SAME(&r->prefix.prefix, &rt->prefix.prefix)) {
if ((r->metric > rt->metric) ||
(r->metric == rt->metric))
*count += 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a local variable instead and later use return count

isisd/isis_lsp.c Outdated
if ((r->metric > rt->metric) ||
(r->metric == rt->metric))
*count += 1;
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you code terminate the loop once a first occurrence has been founded. Thus, the value of count will be 0 or 1. May be returning a boolean should be sufficient if it is really the goal of this function. If the objective is to count the number of extended IP reachability TLV that have the same IPv4 prefix, you should remove the break instruction.

isisd/isis_lsp.c Outdated
Comment on lines 1090 to 1075
void iteration_in_lsp_ipv6(struct isis_ipv6_reach *r, struct isis_lsp *lsp,
int *count)
{
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 (IPV6_ADDR_SAME(&r->prefix.prefix.s6_addr,
&rt->prefix.prefix.s6_addr)) {
if ((r->metric > rt->metric) ||
(r->metric == rt->metric))
*count += 1;
break;
}
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as for IPv4 function

@riw777
Copy link
Member

riw777 commented Jan 16, 2024

@Sashhkaa still working on this?

@github-actions github-actions bot added size/XXL and removed size/M labels Apr 27, 2024
@squirrelking57 squirrelking57 deleted the multiarea_isis branch April 27, 2024 16:00
@squirrelking57 squirrelking57 restored the multiarea_isis branch April 27, 2024 16:01
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@ton31337 ton31337 merged commit 48805d6 into FRRouting:master Apr 27, 2024
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants