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/rip/rip.c | |
parent | d8661a4397e4576ac404661b192dd99d928e7890 (diff) |
Moved route preference to eattrs
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r-- | proto/rip/rip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 52a3bd2c..244bcd0a 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -152,7 +152,6 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en) { /* Update */ rta a0 = { - .pref = p->p.main_channel->preference, .source = RTS_RIP, .scope = SCOPE_UNIVERSE, .dest = RTD_UNICAST, @@ -197,11 +196,12 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en) struct { ea_list l; - eattr a[3]; + eattr a[4]; struct rip_iface_adata riad; } ea_block = { - .l.count = 3, + .l.count = ARRAY_SIZE(ea_block.a), .a = { + EA_LITERAL_EMBEDDED(&ea_gen_preference, 0, p->p.main_channel->preference), EA_LITERAL_EMBEDDED(&ea_rip_metric, 0, rt_metric), EA_LITERAL_EMBEDDED(&ea_rip_tag, 0, rt_tag), EA_LITERAL_DIRECT_ADATA(&ea_rip_from, 0, &ea_block.riad.ad), @@ -1210,7 +1210,7 @@ rip_get_route_info(rte *rte, byte *buf) u32 rt_metric = ea_get_int(rte->attrs->eattrs, &ea_rip_metric, p->infinity); u32 rt_tag = ea_get_int(rte->attrs->eattrs, &ea_rip_tag, 0); - buf += bsprintf(buf, " (%d/%d)", rte->attrs->pref, rt_metric); + buf += bsprintf(buf, " (%d/%d)", rt_get_preference(rte), rt_metric); if (rt_tag) bsprintf(buf, " [%04x]", rt_tag); |