fix(routes): give an FRR host route without a length /128 for IPv6

The FRR enrichment in get_route_to completed every prefix without a
length with /32. An IPv6 host route became a different, much larger
/32 prefix, so it missed the kernel's /128 entry for the same host
(stored that way since #6) and added a bogus one instead.

with_length() in _routes.py completes a prefix by its family, /32 or
/128. The protocol attributes move onto IpRoute, which keeps the import
in linux.py on one line; get_route_to shrinks and the baseline records
it.

Closes #64
This commit is contained in:
Christian Manivong committed 2026-11-02 08:48:39 +01:00
1 parent a1e8ec78c3
commit 9089429c2d
5 files changed
+62 -12

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@
"napalm_linux/linux.py::LinuxDriver._collect_platform_info": 24,
"napalm_linux/linux.py::LinuxDriver._parse_cron_line": 12,
"napalm_linux/linux.py::LinuxDriver.get_networks": 13,
"napalm_linux/linux.py::LinuxDriver.get_route_to": 14,
"napalm_linux/linux.py::LinuxDriver.get_route_to": 13,
"napalm_linux/linux.py::LinuxDriver.get_snmp_config": 13,
"napalm_linux/linux.py::LinuxDriver.get_vpn_tunnels": 28,
"napalm_linux/linux.py::LinuxDriver.search_packages": 26
@@ -12,7 +12,7 @@
"function_lines": {
"napalm_linux/linux.py::LinuxDriver._collect_platform_info": 106,
"napalm_linux/linux.py::LinuxDriver.get_networks": 52,
"napalm_linux/linux.py::LinuxDriver.get_route_to": 103,
"napalm_linux/linux.py::LinuxDriver.get_route_to": 101,
"napalm_linux/linux.py::LinuxDriver.get_vpn_tunnels": 152,
"napalm_linux/linux.py::LinuxDriver.search_packages": 106,
"napalm_linux/linux.py::LinuxDriver.uninstall_package": 51
@@ -21,7 +21,7 @@
"napalm_linux.linux"
],
"python_file_lines": {
"napalm_linux/linux.py": 2140
"napalm_linux/linux.py": 2138
},
"untyped_public": []
}