From: Maria Matejka Date: Wed, 13 Jul 2022 10:54:20 +0000 (+0200) Subject: Merge commit 'd429bc5c841a8e9d4c81786973edfa56d20a407e' into thread-next X-Git-Tag: v3.0-alpha1~171^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af0d5ec2797bab2a928fa8ce2caf81608a3f7443;p=thirdparty%2Fbird.git Merge commit 'd429bc5c841a8e9d4c81786973edfa56d20a407e' into thread-next --- af0d5ec2797bab2a928fa8ce2caf81608a3f7443 diff --cc proto/babel/babel.c index 8b6abacb9,7ea1aba89..00b9aa795 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@@ -2257,15 -2256,11 +2257,15 @@@ babel_kick_timer(struct babel_proto *p static int - babel_preexport(struct channel *c, struct rte *new) + babel_preexport(struct channel *C, struct rte *new) { - if (new->src->proto != c->proto) - 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, &ea_gen_nexthop); + struct nexthop_adata *nhad = (void *) ea->u.ptr; + if (!NEXTHOP_IS_REACHABLE(nhad)) return -1; return 0; diff --cc proto/pipe/pipe.c index 351db36ba,1f1ad8574..8af6de814 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@@ -73,24 -97,12 +73,24 @@@ pipe_rt_notify(struct proto *P, struct } static int - pipe_preexport(struct channel *c, rte *e) + pipe_preexport(struct channel *C, rte *e) { - struct pipe_proto *p = (void *) c->proto; - struct proto *pp = e->sender->proto; ++ struct pipe_proto *p = (void *) C->proto; - if (pp == C->proto) - return -1; /* Avoid local loops automatically */ + /* Avoid direct loopbacks */ - if (e->sender == c->in_req.hook) ++ if (e->sender == C->in_req.hook) + return -1; + + /* Indirection check */ + uint max_generation = ((struct pipe_config *) p->p.cf)->max_generation; + if (e->generation >= max_generation) + { + log_rl(&p->rl_gen, L_ERR "Route overpiped (%u hops of %u configured in %s) in table %s: %N %s/%u:%u", - e->generation, max_generation, c->proto->name, - c->table->name, e->net, e->src->proto->name, e->src->private_id, e->src->global_id); ++ e->generation, max_generation, C->proto->name, ++ C->table->name, e->net, e->src->proto->name, e->src->private_id, e->src->global_id); + + return -1; + } return 0; } diff --cc sysdep/unix/krt.c index 67d19cbb4,be547a936..46b5a51d4 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@@ -681,9 -889,10 +681,9 @@@ krt_scan_timer_kick(struct krt_proto *p */ static int - krt_preexport(struct channel *c, rte *e) + krt_preexport(struct channel *C, rte *e) { - if (e->src->proto == c->proto) - // struct krt_proto *p = (struct krt_proto *) P; + if (e->src->proto == C->proto) return -1; if (!krt_capable(e))