diff options
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/linux/netlink.c | 3 | ||||
-rw-r--r-- | sysdep/unix/krt.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 29b744cb..d8ac2e82 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -1580,7 +1580,7 @@ nl_mergable_route(struct nl_parse_state *s, net *net, struct krt_proto *p, uint static void nl_announce_route(struct nl_parse_state *s) { - rte *e = rte_get_temp(s->attrs); + rte *e = rte_get_temp(s->attrs, s->proto->p.main_source); e->net = s->net; e->u.krt.src = s->krt_src; e->u.krt.proto = s->krt_proto; @@ -1755,7 +1755,6 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) nl_announce_route(s); rta *ra = lp_allocz(s->pool, RTA_MAX_SIZE); - ra->src = p->p.main_source; ra->source = RTS_INHERIT; ra->scope = SCOPE_UNIVERSE; 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)) |