From: anlan_cs Date: Tue, 9 Aug 2022 00:41:22 +0000 (-0400) Subject: ospf6d: fix missing cost change X-Git-Tag: base_8.4~135^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4f0d3f3e8a431441654b663492cb41ed890dc417;p=matthieu%2Ffrr.git ospf6d: fix missing cost change After all needed interfaces ( for example: interface "a1", vrf "vrf1", and "a1" is binded to "vrf1" ) are ready/created, then restart/start frr. zebra at startup will call `netlink_interface()` to process all interfaces and notify all clients, but its calling `get_iflink_speed()` maybe fails for unexpected order of the coming interfaces: when processing "a1", "vrf1" maybe is unknown at that time. `if_zebra_speed_update()` timer is introduced to deal with this order problem. Currently only ospfd and ospf6d deal with this speed change to recalculated route cost. ospfd can deal with this change, but ospf6d will wrongly missed it. Since both `ipv6 ospf6 cost COST` and `auto-cost reference-bandwidth COST` are not set, cost of this ospf6 interface should be calculated with interface speed, but it is wrongly kept to `10`, which is based on interface speed being `0` for it missed speed change. Further, ECMP function becomes invalid after restart frr, beacuse some ospf6 interfaces of one ECMP are wrongly with cost `10`. To avoid missing, recalculate cost for ospf6 interfaces based on potentially changed speed. Signed-off-by: anlan_cs --- diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index efa5d2b7ab..9bc81398c6 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1719,8 +1719,11 @@ void ospf6_interface_start(struct ospf6_interface *oi) if (oi->area_id_format == OSPF6_AREA_FMT_UNSET) return; - if (oi->area) + if (oi->area) { + /* Recompute cost */ + ospf6_interface_recalculate_cost(oi); return; + } ospf6 = oi->interface->vrf->info; if (!ospf6)