summaryrefslogtreecommitdiffstats
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-08-02 13:11:53 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-08-02 13:11:53 +0200
commitba5e5940aa1f11128c76a3964823bda22e47ab04 (patch)
tree7bd7dc426fb1d3ee2b940d981159fdf9780883ec /proto/ospf
parentd395fe48553062413a85fd04cda0752f933e70c6 (diff)
downloadbird-ba5e5940aa1f11128c76a3964823bda22e47ab04.tar
bird-ba5e5940aa1f11128c76a3964823bda22e47ab04.zip
Adds igp_metric attribute.
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 316d729..e1ba96a 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 */
}