summaryrefslogtreecommitdiff
path: root/sysdep/unix/krt.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-09 10:56:06 +0100
committerMaria Matejka <mq@ucw.cz>2022-03-09 10:56:06 +0100
commit83d9920f90738e4df75b3cf57335b43c094051cd (patch)
treeef427685ad08c0ca468db1c0c2f462c3b79b3c14 /sysdep/unix/krt.c
parentff47cd80dd04bc11692248a40cbf52ee8d351064 (diff)
parent5cff1d5f022755df61af6fc21cc4f2e5d384404e (diff)
Merge commit '5cff1d5f' into haugesund
Conflicts: proto/bgp/attrs.c proto/pipe/pipe.c
Diffstat (limited to 'sysdep/unix/krt.c')
-rw-r--r--sysdep/unix/krt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index da61fc9c..c03fa047 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -300,7 +300,7 @@ krt_learn_announce_update(struct krt_proto *p, rte *e)
{
net *n = e->net;
rta *aa = rta_clone(e->attrs);
- rte *ee = rte_get_temp(aa);
+ rte *ee = rte_get_temp(aa, p->p.main_source);
ee->pflags = EA_ID_FLAG(EA_KRT_SOURCE) | EA_ID_FLAG(EA_KRT_METRIC);
ee->u.krt = e->u.krt;
rte_update(&p->p, n->n.addr, ee);
@@ -433,6 +433,9 @@ krt_learn_async(struct krt_proto *p, rte *e, int new)
net *n = net_get(p->krt_table, n0->n.addr);
rte *g, **gg, *best, **bestp, *old_best;
+ ASSERT(!e->attrs->cached);
+ e->attrs->pref = p->p.main_channel->preference;
+
e->attrs = rta_lookup(e->attrs);
old_best = n->routes;
@@ -906,7 +909,7 @@ static int
krt_preexport(struct proto *P, rte *e)
{
// struct krt_proto *p = (struct krt_proto *) P;
- if (e->attrs->src->proto == P)
+ if (e->src->proto == P)
return -1;
if (!krt_capable(e))