Changing OSPF attributes in pipe filter - Bug?
I'm importing BGP and OSPF routes from several interfaces, and I would like to use the OSPF metrics as-is on the local router. However, I'm exporting these routes via OSPF on several other interfaces, and I'd like to selectively override the OSPF metric on some (but not all) of the routes before performing route selection and exporting them via OSPF on the other interfaces. Having successfully done similar things in the past with bird, I expected I should be able to do this in a pipe filter: protocol pipe master_to_adjusted { table master; peer table adjusted; export filter { if ! defined(ospf_metric1) then accept; if true then ospf_metric1 = ospf_metric1 + 1000; accept; }; } However, that isn't working; ospf_metric1 is not changing. If I use the same filter as an import filter in "protocol ospf" instance, it works fine (except that I don't want the metric changed there, since I don't want this affecting route selection on the local router). If I set a different attribute that doesn't already exist (eg. ospf_metric2 or ospf_tag) in the pipe filter, it works fine. If I set ospf_tag in the "protocol ospf" filter, then try to change it in the pipe filter, the change does not work. If I "unset(ospf_metric1);" in the pipe filter then the routes are silently rejected. I don't have the same problem with BGP routes. For example, "bgp_path.prepend(123);" in the pipe filter works as expected. Similarly, setting ospf_metric1 on a BGP route in the "protocol ospf" filter, then changing it in the pipe filter works as expected. I'm running bird 2.0.7 (installed via the distro package on Ubuntu 18.04) - I have not tested with 2.0.8. Am I doing something wrong, or is this a bug? Thanks! -Paul
On Sat, Jun 12, 2021 at 12:51:37PM -0400, Paul Donohue wrote:
I'm importing BGP and OSPF routes from several interfaces, and I would like to use the OSPF metrics as-is on the local router. However, I'm exporting these routes via OSPF on several other interfaces, and I'd like to selectively override the OSPF metric on some (but not all) of the routes before performing route selection and exporting them via OSPF on the other interfaces.
...
However, that isn't working; ospf_metric1 is not changing.
Am I doing something wrong, or is this a bug?
Hi It seems that there is a bug that causes a class of attributes not work properly when set in pipe filters. Some attributes (i.e. OSPF ones for OSPF route) are stored directly in the route structure and not in a separate attribute list. They are expanded to attribute list and they are not properly stored back when passed through pipe. BGP attributes or OSPF attributes on non-BGP routes are always in attribute list, so they are handled properly. Will check that and fix that. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On Mon, Jun 14, 2021 at 03:31:45PM +0200, Ondrej Zajicek wrote:
On Sat, Jun 12, 2021 at 12:51:37PM -0400, Paul Donohue wrote:
I'm importing BGP and OSPF routes from several interfaces, and I would like to use the OSPF metrics as-is on the local router. However, I'm exporting these routes via OSPF on several other interfaces, and I'd like to selectively override the OSPF metric on some (but not all) of the routes before performing route selection and exporting them via OSPF on the other interfaces.
...
However, that isn't working; ospf_metric1 is not changing.
Am I doing something wrong, or is this a bug?
Hi, fixed: https://gitlab.nic.cz/labs/bird/-/commit/1b9bf4e192a252db861acadc7f800d70464... -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On Tue, Jun 15, 2021 at 04:14:03PM +0200, Ondrej Zajicek wrote:
On Mon, Jun 14, 2021 at 03:31:45PM +0200, Ondrej Zajicek wrote:
On Sat, Jun 12, 2021 at 12:51:37PM -0400, Paul Donohue wrote:
I'm importing BGP and OSPF routes from several interfaces, and I would like to use the OSPF metrics as-is on the local router. However, I'm exporting these routes via OSPF on several other interfaces, and I'd like to selectively override the OSPF metric on some (but not all) of the routes before performing route selection and exporting them via OSPF on the other interfaces.
...
However, that isn't working; ospf_metric1 is not changing.
Am I doing something wrong, or is this a bug?
Hi, fixed:
https://gitlab.nic.cz/labs/bird/-/commit/1b9bf4e192a252db861acadc7f800d70464...
Confirmed. That fixes it for me. Thank you very much! I really appreciate all of your work on BIRD! -Paul
participants (3)
-
Ondrej Zajicek -
Paul Donohue -
Paul Donohue