summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-08-02 22:08:59 +0200
committerMaria Matejka <mq@ucw.cz>2022-08-02 22:08:59 +0200
commit71b434a987067475b517792360f58dbe03bfee9e (patch)
treea6bad599a80fd6dd16b0117f16e95a5c213cfe8d /sysdep/unix
parent0072d11f3431165240656edf6ade473554b8747e (diff)
parentf0507f05ce57398e135651896dace4cb68eeed54 (diff)
Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-next
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 46b5a51d..f796a159 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -314,6 +314,7 @@ krt_learn_scan(struct krt_proto *p, rte *e)
ea_set_attr_u32(&e0.attrs, &ea_gen_preference, 0, p->p.main_channel->preference);
rte_update(p->p.main_channel, e->net, &e0, e0.src);
+ rt_unlock_source(e0.src);
}
static void
@@ -322,9 +323,9 @@ krt_learn_async(struct krt_proto *p, rte *e, int new)
if (new)
return krt_learn_scan(p, e);
- struct rte_src *src = rt_find_source(&p->p, krt_metric(e));
- if (src)
- rte_update(p->p.main_channel, e->net, NULL, src);
+ struct rte_src *src = rt_get_source(&p->p, krt_metric(e));
+ rte_update(p->p.main_channel, e->net, NULL, src);
+ rt_unlock_source(src);
}
#endif
@@ -683,7 +684,7 @@ krt_scan_timer_kick(struct krt_proto *p)
static int
krt_preexport(struct channel *C, rte *e)
{
- if (e->src->proto == C->proto)
+ if (e->src->owner == &C->proto->sources)
return -1;
if (!krt_capable(e))