diff options
author | Maria Matejka <mq@ucw.cz> | 2022-06-08 11:47:49 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-06-08 11:47:49 +0200 |
commit | cae5979871ee7aa341334f8b1af6bafc60ee9692 (patch) | |
tree | 490f68c9c5d856ab560f2194fe350cd68039cccd /proto/babel | |
parent | 8fd3811d9d29d73570e03147eb024a4e5fde199b (diff) | |
parent | 950775f6fa3d569a9d7cd05e33538d35e895d688 (diff) |
Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesund
There were quite a lot of conflicts in flowspec validation code which
ultimately led to some code being a bit rewritten, not only adapted from
this or that branch, yet it is still in a limit of a merge.
Diffstat (limited to 'proto/babel')
-rw-r--r-- | proto/babel/babel.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index f3456369..65d2567e 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -677,10 +677,7 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) } }; - rta a0 = { - .dest = RTD_UNICAST, - .eattrs = &eattrs.l, - }; + rta a0 = { .eattrs = &eattrs.l, }; rte e0 = { .attrs = &a0, @@ -693,12 +690,11 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) else if (e->valid && (e->router_id != p->router_id)) { /* Unreachable */ - rta a0 = { - .dest = RTD_UNREACHABLE, - }; + rta a0 = {}; ea_set_attr_u32(&a0.eattrs, &ea_gen_preference, 0, 1); ea_set_attr_u32(&a0.eattrs, &ea_gen_source, 0, RTS_BABEL); + ea_set_dest(&a0.eattrs, 0, RTD_UNREACHABLE); rte e0 = { .attrs = &a0, @@ -2266,9 +2262,13 @@ babel_kick_timer(struct babel_proto *p) static int babel_preexport(struct channel *c, struct rte *new) { - struct rta *a = new->attrs; + if (new->src->proto != c->proto) + return 0; + /* Reject our own unreachable routes */ - if ((a->dest == RTD_UNREACHABLE) && (new->src->proto == c->proto)) + eattr *ea = ea_find(new->attrs->eattrs, &ea_gen_nexthop); + struct nexthop_adata *nhad = (void *) ea->u.ptr; + if (!NEXTHOP_IS_REACHABLE(nhad)) return -1; return 0; |