]> 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)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 24 Mar 2021 12:16:18 +0000 (15:16 +0300)
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 ab6a0f9639a8a6c7cfd41dbb15206ecbac6d25a4..68e67e0d43442c4cab5c60a8f7fb1a71c4eb334a 100644 (file)
@@ -1327,12 +1327,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;