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

[IPRoute] Filter args not honored since pyroute2>0.8.1 #1225

Open
karelyatin opened this issue Dec 30, 2024 · 1 comment
Open

[IPRoute] Filter args not honored since pyroute2>0.8.1 #1225

karelyatin opened this issue Dec 30, 2024 · 1 comment
Labels

Comments

@karelyatin
Copy link

karelyatin commented Dec 30, 2024

In OpenStack neutron we have a periodic job running with pyroute2 master(currently at commit e106ce4) and since the merge of thread-unsafe branch in master the job started to fail https://bugs.launchpad.net/neutron/+bug/2092567

The failure is related to ip route show not honoring filter flags.

Reproducer:-
from pyroute2 import IPRoute
ip = IPRoute()
routes = ip.route('show', table=255)
print("Total routes: %d, Routes List: %s" % (len(routes), [route['table'] for route in routes]))

With master branch it returns:-
Total routes: 20, Routes List: [254, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 254, 254, 254, 254, 255, 255, 255, 255]

With 0.8.1 it returns:-
Total routes: 5, Routes List: [255, 255, 255, 255, 255]

Similar applies to other args like family.
from pyroute2 import IPRoute
ip = IPRoute()
routes = ip.route('show', table=255, family=1)
print("Total routes: %d, Routes List: %s" % (len(routes), [route['table'] for route in routes]))

With master it returns:-
Total routes: 20, Routes List: [254, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 254, 254, 254, 254, 255, 255, 255, 255]

With 0.8.1 it returns:-
Total routes: 0, Routes List: []

with strict_check it slightly differs.
from pyroute2 import IPRoute
ip = IPRoute(strict_check=True)
routes = ip.route('show',table=255, family=1)
print("Total routes: %d, Routes List: %s" % (len(routes), [route['table'] for route in routes]))

With master branch it returns:-
Total routes: 9, Routes List: [255, 255, 255, 255, 255, 255, 255, 255, 255]

With 0.8.1 it returns:-
Total routes: 0, Routes List: []

@karelyatin karelyatin changed the title Filter args not honored since pyroute2>0.8.1 [IPRoute] Filter args not honored since pyroute2>0.8.1 Dec 30, 2024
@svinota svinota added the bug label Jan 3, 2025
@svinota
Copy link
Owner

svinota commented Jan 3, 2025

Thanks for reporting! Fixing

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

2 participants