summaryrefslogtreecommitdiff
path: root/proto/ospf
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/ospf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 316d7292..e1ba96a4 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -467,7 +467,11 @@ ospf_import_control(struct proto *p, rte ** new, ea_list ** attrs,
if (p == e->attrs->proto)
return -1; /* Reject our own routes */
- *attrs = ospf_build_attrs(*attrs, pool, LSINFINITY, 10000, 0, 0);
+
+ eattr *ea = ea_find(e->attrs->eattrs, EA_GEN_IGP_METRIC);
+ u32 m1 = (ea && (ea->u.data < LSINFINITY)) ? ea->u.data : LSINFINITY;
+
+ *attrs = ospf_build_attrs(*attrs, pool, m1, 10000, 0, 0);
return 0; /* Leave decision to the filters */
}