]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: fix setting NOAUTOCOST flag
authorEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 3 Mar 2021 09:56:51 +0000 (10:56 +0100)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 3 Mar 2021 09:56:51 +0000 (10:56 +0100)
ospf6 keeps a flag to remember whether the cost for an interface
was manually added via config or computed automatically, but if
the configured value matches the auto-computed one we were not
setting this flag, meaning that the config would not show up in
the config.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
ospf6d/ospf6_interface.c

index 621cc36a0cb27a15e0399c8f770dc669c754c1e2..a5d9138743a684c6bae5590c56babe73e83375a1 100644 (file)
@@ -1622,12 +1622,11 @@ DEFUN (ipv6_ospf6_cost,
                return CMD_WARNING_CONFIG_FAILED;
        }
 
+       SET_FLAG(oi->flag, OSPF6_INTERFACE_NOAUTOCOST);
        if (oi->cost == lcost)
                return CMD_SUCCESS;
 
        oi->cost = lcost;
-       SET_FLAG(oi->flag, OSPF6_INTERFACE_NOAUTOCOST);
-
        ospf6_interface_force_recalculate_cost(oi);
 
        return CMD_SUCCESS;