summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-11-07 09:51:21 +0100
committerMaria Matejka <mq@ucw.cz>2022-11-07 09:51:21 +0100
commitd2d83c47776e1655a73e9134c87590bae084b03b (patch)
treeefeb226ca34e9c33412efd20f2bd0c8279e265ac /sysdep/unix
parent8d7f516b2a255a40659ce7857fe30937a6ecf7f2 (diff)
parent0f2be469f897b6d9f925563bbf522438c83522ea (diff)
Merge commit '0f2be469' into thread-next
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index b0033a65..3b6c91cc 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -302,6 +302,12 @@ krt_uptodate(rte *a, rte *b)
return (a->attrs == b->attrs);
}
+static void
+krt_learn_alien_attr(struct channel *c, rte *e)
+{
+ ea_set_attr_u32(&e->attrs, &ea_gen_preference, 0, c->preference);
+}
+
/* Called when alien route is discovered during scan */
static void
krt_learn_scan(struct krt_proto *p, rte *e)
@@ -311,7 +317,7 @@ krt_learn_scan(struct krt_proto *p, rte *e)
.src = rt_get_source(&p->p, krt_metric(e)),
};
- ea_set_attr_u32(&e0.attrs, &ea_gen_preference, 0, p->p.main_channel->preference);
+ krt_learn_alien_attr(p->p.main_channel, &e0);
rte_update(p->p.main_channel, e->net, &e0, e0.src);
rt_unlock_source(e0.src);