]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #3086 from patrasar/1836
authorDavid Lamparter <equinox@diac24.net>
Mon, 1 Oct 2018 13:26:40 +0000 (15:26 +0200)
committerGitHub <noreply@github.com>
Mon, 1 Oct 2018 13:26:40 +0000 (15:26 +0200)
ospfd: handling of OSPF_AREA_RANGE_ADVERTISE flag

ospf6d/ospf6_area.c
ospfd/ospf_abr.c
ospfd/ospf_vty.c

index 2cab69aac221e1c2a1fcb11e56f586099104e6ed..f72ca63ff9f06c48c6f3a19fc3756b07d2815c9d 100644 (file)
@@ -441,6 +441,7 @@ DEFUN (area_range,
                        SET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
                } else if (strmatch(argv[idx_type]->text, "advertise")) {
                        UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
+                       cost = range->path.u.cost_config;
                } else {
                        cost = strtoul(argv[5]->arg, NULL, 10);
                        UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
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;
 }
index e25d1a31dedf333b164a2708da6012f9ad1a25de..25d54a8553ed5e04f81fc9a09f6d1c84404ee434 100644 (file)
@@ -750,6 +750,7 @@ DEFUN (ospf_area_range_not_advertise,
        ospf_area_range_set(ospf, area_id, &p, 0);
        ospf_area_display_format_set(ospf, ospf_area_get(ospf, area_id),
                                     format);
+       ospf_area_range_substitute_unset(ospf, area_id, &p);
 
        return CMD_SUCCESS;
 }