diff options
author | Maria Matejka <mq@ucw.cz> | 2020-04-10 17:08:29 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-10-13 19:09:04 +0200 |
commit | 5cff1d5f022755df61af6fc21cc4f2e5d384404e (patch) | |
tree | d98b4b352a47257fe3943dcb050ff73c5c14aecf /proto/babel | |
parent | eb937358c087eaeb6f209660cc7ecfe6d6eff739 (diff) |
Route: moved rte_src pointer from rta to rte
It is an auxiliary key in the routing table, not a route attribute.
Diffstat (limited to 'proto/babel')
-rw-r--r-- | proto/babel/babel.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 246eea00..1d23aef7 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -641,7 +641,6 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) if (r) { rta a0 = { - .src = p->p.main_source, .source = RTS_BABEL, .scope = SCOPE_UNIVERSE, .dest = RTD_UNICAST, @@ -660,7 +659,7 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) a0.nh.flags = RNF_ONLINK; rta *a = rta_lookup(&a0); - rte *rte = rte_get_temp(a); + rte *rte = rte_get_temp(a, p->p.main_source); rte->u.babel.seqno = r->seqno; rte->u.babel.metric = r->metric; rte->u.babel.router_id = r->router_id; @@ -673,7 +672,6 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) { /* Unreachable */ rta a0 = { - .src = p->p.main_source, .source = RTS_BABEL, .scope = SCOPE_UNIVERSE, .dest = RTD_UNREACHABLE, @@ -681,7 +679,7 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) }; rta *a = rta_lookup(&a0); - rte *rte = rte_get_temp(a); + rte *rte = rte_get_temp(a, p->p.main_source); memset(&rte->u.babel, 0, sizeof(rte->u.babel)); rte->pflags = 0; @@ -2236,7 +2234,7 @@ babel_preexport(struct proto *P, struct rte *new) { struct rta *a = new->attrs; /* Reject our own unreachable routes */ - if ((a->dest == RTD_UNREACHABLE) && (a->src->proto == P)) + if ((a->dest == RTD_UNREACHABLE) && (new->src->proto == P)) return -1; return 0; @@ -2277,7 +2275,7 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net, if (new) { /* Update */ - uint internal = (new->attrs->src->proto == P); + uint internal = (new->src->proto == P); uint rt_seqno = internal ? new->u.babel.seqno : p->update_seqno; uint rt_metric = ea_get_int(new->attrs->eattrs, EA_BABEL_METRIC, 0); u64 rt_router_id = internal ? new->u.babel.router_id : p->router_id; |