summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYash Ranjan <ranjany@vmware.com>2021-06-02 14:45:18 +0200
committerYash Ranjan <ranjany@vmware.com>2021-06-18 13:59:04 +0200
commitf84504e686aa52591e0a3c211cfd1b5afe324756 (patch)
tree74e252d5318a75e40ffc5facd454f453b9357172
parentospf6d: Change the default metric parameter for redistribute (diff)
downloadfrr-f84504e686aa52591e0a3c211cfd1b5afe324756.tar.xz
frr-f84504e686aa52591e0a3c211cfd1b5afe324756.zip
ospf6d: Set metric from default values when route-map metric not present
For redistribute commands if route map is set, then route takes it's metric values from the route map. But in the case that routemap is set but the metric for the route map is not, then the route metric is set to type-1. Check if the metric is set for the routemap. If not then set it as per redistributed default values (type 2) Signed-off-by: Yash Ranjan <ranjany@vmware.com>
-rw-r--r--ospf6d/ospf6_asbr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index cc4b220ec..c17af758b 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1378,8 +1378,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
if (troute.path.metric_type)
match->path.metric_type =
troute.path.metric_type;
+ else
+ match->path.metric_type =
+ metric_type(ospf6, type, 0);
if (troute.path.cost)
match->path.cost = troute.path.cost;
+ else
+ match->path.cost = metric_value(ospf6, type, 0);
if (!IN6_IS_ADDR_UNSPECIFIED(&tinfo.forwarding))
memcpy(&info->forwarding, &tinfo.forwarding,
sizeof(struct in6_addr));
@@ -1440,8 +1445,12 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
if (ROUTEMAP(red)) {
if (troute.path.metric_type)
route->path.metric_type = troute.path.metric_type;
+ else
+ route->path.metric_type = metric_type(ospf6, type, 0);
if (troute.path.cost)
route->path.cost = troute.path.cost;
+ else
+ route->path.cost = metric_value(ospf6, type, 0);
if (!IN6_IS_ADDR_UNSPECIFIED(&tinfo.forwarding))
memcpy(&info->forwarding, &tinfo.forwarding,
sizeof(struct in6_addr));