summaryrefslogtreecommitdiff
path: root/proto/babel
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-10-04 15:53:12 +0200
committerMaria Matejka <mq@ucw.cz>2022-10-04 15:53:12 +0200
commit4e1c582caddb6876b9fcbdc29b8bad5ab0b09ee7 (patch)
treec46d8e5337bc12ec01e3d91b9c2f5f6dd61eb8ad /proto/babel
parentbecca314e2546d6005a23398ce2d3012d4b396cb (diff)
parent71b434a987067475b517792360f58dbe03bfee9e (diff)
Merge commit '71b434a9' into HEAD
Diffstat (limited to 'proto/babel')
-rw-r--r--proto/babel/babel.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 00b9aa79..4d024e3a 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -2259,7 +2259,7 @@ babel_kick_timer(struct babel_proto *p)
static int
babel_preexport(struct channel *C, struct rte *new)
{
- if (new->src->proto != C->proto)
+ if (new->src->owner != &C->proto->sources)
return 0;
/* Reject our own unreachable routes */
@@ -2289,7 +2289,7 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, const net_addr *net,
uint rt_metric = ea_get_int(new->attrs, &ea_babel_metric, 0);
u64 rt_router_id = 0;
- if (new->src->proto == P)
+ if (new->src->owner == &P->sources)
{
rt_seqno = ea_get_int(new->attrs, &ea_babel_seqno, 0);
eattr *e = ea_find(new->attrs, &ea_babel_router_id);
@@ -2373,6 +2373,12 @@ babel_postconfig(struct proto_config *CF)
cf->ip6_channel = ip6 ?: ip6_sadr;
}
+static struct rte_owner_class babel_rte_owner_class = {
+ .get_route_info = babel_get_route_info,
+ .rte_better = babel_rte_better,
+ .rte_igp_metric = babel_rte_igp_metric,
+};
+
static struct proto *
babel_init(struct proto_config *CF)
{
@@ -2386,8 +2392,8 @@ babel_init(struct proto_config *CF)
P->if_notify = babel_if_notify;
P->rt_notify = babel_rt_notify;
P->preexport = babel_preexport;
- P->rte_better = babel_rte_better;
- P->rte_igp_metric = babel_rte_igp_metric;
+
+ P->sources.class = &babel_rte_owner_class;
return P;
}
@@ -2498,7 +2504,6 @@ struct protocol proto_babel = {
.start = babel_start,
.shutdown = babel_shutdown,
.reconfigure = babel_reconfigure,
- .get_route_info = babel_get_route_info,
};
void