diff options
author | Maria Matejka <mq@ucw.cz> | 2022-04-20 12:24:26 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:39:21 +0200 |
commit | 337c04c45e1472d6d9b531a3c55f1f2d30ebf308 (patch) | |
tree | 7526f6f33a6a57404ed9b15588b1a3fc3eb40182 /proto/ospf | |
parent | d8661a4397e4576ac404661b192dd99d928e7890 (diff) |
Moved route preference to eattrs
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/ospf.c | 2 | ||||
-rw-r--r-- | proto/ospf/rt.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 66d0eba6..427c2c86 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -588,7 +588,7 @@ ospf_get_route_info(rte * rte, byte * buf) } buf += bsprintf(buf, " %s", type); - buf += bsprintf(buf, " (%d/%d", rte->attrs->pref, ea_get_int(rte->attrs->eattrs, &ea_ospf_metric1, LSINFINITY)); + buf += bsprintf(buf, " (%d/%d", rt_get_preference(rte), ea_get_int(rte->attrs->eattrs, &ea_ospf_metric1, LSINFINITY)); if (rte->attrs->source == RTS_OSPF_EXT2) buf += bsprintf(buf, "/%d", ea_get_int(rte->attrs->eattrs, &ea_ospf_metric2, LSINFINITY)); buf += bsprintf(buf, ")"); diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 55bad599..3d8cf22c 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -2057,7 +2057,6 @@ again1: .scope = SCOPE_UNIVERSE, .dest = RTD_UNICAST, .nh = *(nf->n.nhs), - .pref = p->p.main_channel->preference, }; if (reload || ort_changed(nf, &a0)) @@ -2069,12 +2068,15 @@ again1: struct { ea_list l; - eattr a[4]; + eattr a[5]; } eattrs; eattrs.l = (ea_list) {}; eattrs.a[eattrs.l.count++] = + EA_LITERAL_EMBEDDED(&ea_gen_preference, 0, p->p.main_channel->preference); + + eattrs.a[eattrs.l.count++] = EA_LITERAL_EMBEDDED(&ea_ospf_metric1, 0, nf->n.metric1); if (nf->n.type == RTS_OSPF_EXT2) |