kernel protocol ignores default preference during scan

Alexander Zubkov green at qrator.net
Tue Sep 20 18:23:44 CEST 2022


Hi,

Bird from master branch ignores the default preference set in channel
for a kernel protocol, like that:

protocol kernel {
        learn yes;
        ipv4 {
                preference 200;
                import all;
                export none;
        };
}

Version 2.0.10 seems ok. I suppose the change was introduced with this commit:

https://gitlab.nic.cz/labs/bird/-/commit/eb937358c087eaeb6f209660cc7ecfe6d6eff739

It adds setting of the preference to the krt_learn_async() function.
But as I understand when route is learned with netlink hook it is
processed like this:
nl_parse_route -> krt_got_route_async -> krt_learn_async
But when it is learned from scan, it is processed like this:
nl_parse_route -> krt_got_route -> krt_learn_scan

And setting preference was not added to krt_learn_scan() function.

I also saw that in my test - when I added a new route to the kernel
while bird was running, it appeared in bird with correct preference.
But some time after, the scan updated the route and it was replaced
with the default preference.


More information about the Bird-users mailing list