diff options
Diffstat (limited to 'ospf6d/ospf6_interface.c')
| -rw-r--r-- | ospf6d/ospf6_interface.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index f237e4bef3..98f93b06e6 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -144,15 +144,8 @@ static u_int32_t ospf6_interface_get_cost(struct ospf6_interface *oi) return cost; } -static void ospf6_interface_recalculate_cost(struct ospf6_interface *oi) +static void ospf6_interface_force_recalculate_cost(struct ospf6_interface *oi) { - u_int32_t newcost; - - newcost = ospf6_interface_get_cost(oi); - if (newcost == oi->cost) - return; - oi->cost = newcost; - /* update cost held in route_connected list in ospf6_interface */ ospf6_interface_connected_route_update(oi->interface); @@ -166,6 +159,18 @@ static void ospf6_interface_recalculate_cost(struct ospf6_interface *oi) } } +static void ospf6_interface_recalculate_cost(struct ospf6_interface *oi) +{ + u_int32_t newcost; + + newcost = ospf6_interface_get_cost(oi); + if (newcost == oi->cost) + return; + oi->cost = newcost; + + ospf6_interface_force_recalculate_cost(oi); +} + /* Create new ospf6 interface structure */ struct ospf6_interface *ospf6_interface_create(struct interface *ifp) { @@ -1207,7 +1212,7 @@ DEFUN (ipv6_ospf6_cost, oi->cost = lcost; SET_FLAG(oi->flag, OSPF6_INTERFACE_NOAUTOCOST); - ospf6_interface_recalculate_cost(oi); + ospf6_interface_force_recalculate_cost(oi); return CMD_SUCCESS; } |
