]> git.proxmox.com Git - mirror_frr.git/commit - ospfd/ospf_zebra.c
ospfd: use rib metric as the base for set metric +/-
authorJafar Al-Gharaibeh <jafar@atcorp.com>
Fri, 31 Mar 2023 03:36:13 +0000 (22:36 -0500)
committerJafar Al-Gharaibeh <jafar@atcorp.com>
Tue, 18 Apr 2023 05:21:05 +0000 (00:21 -0500)
commit6af89f8f033b61217322ca1e8fca324f813a1ef5
tree626c01046012a628a44314d6d61e446ef61977ee
parentbe574cf987311bf299de018b71084e69eb08f5fc
ospfd: use rib metric as the base for set metric +/-

When using route maps with external routes in OSPF as follows:
```
   set metric +10
 ```
The current behavior is to use the default ospf metric as the base and then add
to 10 to it. The behavior isn't useful as-is. A value 30 (20 dfeault + 10) can
be set directly instead. the behavior is also not consistent with bgp. bgp does
use the rib metric in this case as the base. The current behavior also doesn't
allow the metric to accumulate when crossing different routing domains such as
vrfs causing the metric to reset every time the route enters a new vrf with a new
ospf network.

This PR changes the behavior such that the rib metric is used as a base for
ospf exteral routes when used with `set metric -/+`

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
ospfd/ospf_asbr.c
ospfd/ospf_asbr.h
ospfd/ospf_ase.c
ospfd/ospf_routemap.c
ospfd/ospf_zebra.c