From ba5e5940aa1f11128c76a3964823bda22e47ab04 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 2 Aug 2010 13:11:53 +0200 Subject: Adds igp_metric attribute. --- proto/ospf/ospf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'proto') 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 */ } -- cgit v1.2.3