return fwd;
}
-#define DEFAULT_DEFAULT_METRIC 20
-#define DEFAULT_DEFAULT_ORIGINATE_METRIC 10
-#define DEFAULT_DEFAULT_ALWAYS_METRIC 1
-
-#define DEFAULT_METRIC_TYPE EXTERNAL_METRIC_TYPE_2
-
int metric_type(struct ospf *ospf, uint8_t src, unsigned short instance)
{
struct ospf_redist *red;
#include "stream.h"
+/* OSPF LSA Default metric values */
+#define DEFAULT_DEFAULT_METRIC 20
+#define DEFAULT_DEFAULT_ORIGINATE_METRIC 10
+#define DEFAULT_DEFAULT_ALWAYS_METRIC 1
+#define DEFAULT_METRIC_TYPE EXTERNAL_METRIC_TYPE_2
+
/* OSPF LSA Range definition. */
#define OSPF_MIN_LSA 1 /* begin range here */
#define OSPF_MAX_LSA 12
/* Set metric out value. */
if (!metric->used)
return RMAP_OKAY;
+
+ ei->route_map_set.metric = DEFAULT_DEFAULT_METRIC;
+
if (metric->type == metric_increment)
ei->route_map_set.metric += metric->metric;
- if (metric->type == metric_decrement)
+ else if (metric->type == metric_decrement)
ei->route_map_set.metric -= metric->metric;
- if (metric->type == metric_absolute)
+ else if (metric->type == metric_absolute)
ei->route_map_set.metric = metric->metric;
- if ((signed int)ei->route_map_set.metric < 1)
- ei->route_map_set.metric = -1;
if (ei->route_map_set.metric > OSPF_LS_INFINITY)
ei->route_map_set.metric = OSPF_LS_INFINITY;
}