summaryrefslogtreecommitdiff
path: root/proto/rip
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 17:18:03 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 17:18:03 +0200
commit1a92ee9d4df265018c0344064019f53bc3afce3a (patch)
tree3eb67d0604086b399618bc525a83ce83deac9eb0 /proto/rip
parent674587d9c84ed70151abc56003c371668079ae31 (diff)
parent337c04c45e1472d6d9b531a3c55f1f2d30ebf308 (diff)
Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesund
Diffstat (limited to 'proto/rip')
-rw-r--r--proto/rip/rip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 739fe96c..cf186f87 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),
@@ -1209,7 +1209,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);