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

Reverse order sorted for display static routes #8794

Closed
ak503 opened this issue Jun 4, 2021 · 6 comments
Closed

Reverse order sorted for display static routes #8794

ak503 opened this issue Jun 4, 2021 · 6 comments
Labels

Comments

@ak503
Copy link
Contributor

ak503 commented Jun 4, 2021

Hello!
If we have in config file some static routes:

ip route 1 ...
ip route 2 ...

then after starting staticd daemon every route will be added to head and in display we see:

ip route 2 ...
ip route 1 ...

May be need use static_path_list_add_tail instead static_path_list_add_head?

static_path_list_add_head(&(si->path_list), pn);

@ak503 ak503 changed the title Reverse order sorted for display routes Reverse order sorted for display static routes Jun 4, 2021
@idryzhov
Copy link
Contributor

idryzhov commented Jun 7, 2021

Isn't this a duplicate of #8746? Please, keep only one of those two.

Anyway, the correct approach for fixing this issue is to output staticd config using NB layer and implement cli_cmp callback for sorting.

@ak503
Copy link
Contributor Author

ak503 commented Jun 8, 2021

Isn't this a duplicate of #8746?

No, this is a separate issues.

@idryzhov
Copy link
Contributor

idryzhov commented Jun 8, 2021

Could you elaborate, please, on how are they separate? They are both about the sorting of static routes in the configuration and FRR just doesn't sort the routes currently.

@ak503
Copy link
Contributor Author

ak503 commented Jun 9, 2021

in #8746 FRR tries to sort by gateway but only if gateway is IP.
If gateway set as ifname, it s not sorting and displayed reverse list everytime after vtysh -c write and restart staticd. But may be it is a common ploblem.

ip route 1.1.1.1/32 lo1
ip route 1.1.1.1/32 lo2
ip route 2.2.2.2/32 3.3.3.2
ip route 2.2.2.2/32 3.3.3.1

after write and restart:

ip route 1.1.1.1/32 lo2
ip route 1.1.1.1/32 lo1
ip route 2.2.2.2/32 3.3.3.2
ip route 2.2.2.2/32 3.3.3.1

after write and restart again:

ip route 1.1.1.1/32 lo1
ip route 1.1.1.1/32 lo2
ip route 2.2.2.2/32 3.3.3.2
ip route 2.2.2.2/32 3.3.3.1

@idryzhov
Copy link
Contributor

idryzhov commented Jun 9, 2021

Thanks, now I see the difference. It tries to sort the routes when the nexthop is an IP address but does it incorrectly. And it doesn't even try to sort them when the nexthop is an interface.

Anyway, both problems should be solved using the NB layer (implementing cli_show and cli_cmp functions for nexthops), so I'd combine them into a single issue.

@qlyoung
Copy link
Member

qlyoung commented Jun 30, 2021

Please merge this problem description into #8746, since the functional impact is the same (none).

@qlyoung qlyoung closed this as completed Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants