0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00

BSD: Fix krt socket code w.r.t. rte/rta changes

This commit is contained in:
Ondrej Zajicek 2022-11-29 19:43:38 +01:00 committed by Igor Putovny
parent ae7838daa1
commit 1011d89e14
2 changed files with 4 additions and 5 deletions

View File

@ -347,7 +347,7 @@ krt_send_route(struct krt_proto *p, int cmd, rte *e)
} }
void void
krt_replace_rte(struct krt_proto *p, net *n, rte *new, rte *old) krt_replace_rte(struct krt_proto *p, net *n UNUSED, rte *new, rte *old)
{ {
int err = 0; int err = 0;
@ -519,7 +519,6 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
net = net_get(p->p.main_channel->table, &ndst); net = net_get(p->p.main_channel->table, &ndst);
rta a = { rta a = {
.src = p->p.main_source,
.source = RTS_INHERIT, .source = RTS_INHERIT,
.scope = SCOPE_UNIVERSE, .scope = SCOPE_UNIVERSE,
}; };
@ -580,7 +579,7 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
} }
done: done:
e = rte_get_temp(&a); e = rte_get_temp(&a, p->p.main_source);
e->net = net; e->net = net;
ea_list *ea = alloca(sizeof(ea_list) + 1 * sizeof(eattr)); ea_list *ea = alloca(sizeof(ea_list) + 1 * sizeof(eattr));
@ -1203,7 +1202,7 @@ kif_update_sysdep_addr(struct iface *i)
return 0; return 0;
ip4_addr old = i->sysdep; ip4_addr old = i->sysdep;
i->sysdep = ipa_to_ip4(ipa_from_sa4(&ifr.ifr_addr)); i->sysdep = ipa_to_ip4(ipa_from_sa4((sockaddr *) &ifr.ifr_addr));
return !ip4_equal(i->sysdep, old); return !ip4_equal(i->sysdep, old);
} }

View File

@ -937,7 +937,7 @@ krt_rt_notify(struct proto *P, struct channel *ch UNUSED, net *net,
* kernel, which would remove the new imported route instead. * kernel, which would remove the new imported route instead.
*/ */
rte *best = net->routes; rte *best = net->routes;
if (!new && best && (best->attrs->src->proto == P)) if (!new && best && (best->src->proto == P))
return; return;
#endif #endif