]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_abr.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / ospfd / ospf_abr.c
index 870037efc0ffc514f062142e2cfa56bc9554e727..c8b8b611efcbd9fdc06ac55af6223e2f50336920 100644 (file)
@@ -196,6 +196,8 @@ int ospf_area_range_set(struct ospf *ospf, struct in_addr area_id,
 
        range = ospf_area_range_lookup(area, p);
        if (range != NULL) {
+               if (!CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE))
+                       range->cost_config = OSPF_AREA_RANGE_COST_UNSPEC;
                if ((CHECK_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE)
                     && !CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE))
                    || (!CHECK_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE)
@@ -209,8 +211,10 @@ int ospf_area_range_set(struct ospf *ospf, struct in_addr area_id,
 
        if (CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE))
                SET_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE);
-       else
+       else {
                UNSET_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE);
+               range->cost_config = OSPF_AREA_RANGE_COST_UNSPEC;
+       }
 
        return 1;
 }