diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-15 18:09:30 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 14:39:09 +0200 |
commit | 950775f6fa3d569a9d7cd05e33538d35e895d688 (patch) | |
tree | 81b4b23d5695e209301b252d0d282b05a0d67ac1 /proto/static | |
parent | 4fe9881d625f10e44109a649e369a413bd98de71 (diff) |
Route destination field merged with nexthop attribute; splitting flowspec validation result out.
As there is either a nexthop or another destination specification
(or othing in case of ROAs and Flowspec), it may be merged together.
This code is somehow quirky and should be replaced in future by better
implementation of nexthop.
Also flowspec validation result has its own attribute now as it doesn't
have anything to do with route nexthop.
Diffstat (limited to 'proto/static')
-rw-r--r-- | proto/static/static.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/proto/static/static.c b/proto/static/static.c index 5102617f..806849c4 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -55,7 +55,6 @@ static_announce_rte(struct static_proto *p, struct static_route *r) { rta *a = allocz(RTA_MAX_SIZE); struct rte_src *src = static_get_source(p, r->index); - a->dest = r->dest; ea_set_attr_u32(&a->eattrs, &ea_gen_preference, 0, p->p.main_channel->preference); ea_set_attr_u32(&a->eattrs, &ea_gen_source, 0, RTS_STATIC); @@ -97,7 +96,7 @@ static_announce_rte(struct static_proto *p, struct static_route *r) nhad->ad.data, (void *) nh - (void *) nhad->ad.data); } - if (r->dest == RTDX_RECURSIVE) + else if (r->dest == RTDX_RECURSIVE) { rtable *tab = ipa_is_ip4(r->via) ? p->igp_table_ip4 : p->igp_table_ip6; u32 *labels = r->mls ? (void *) r->mls->data : NULL; @@ -107,6 +106,9 @@ static_announce_rte(struct static_proto *p, struct static_route *r) r->via, IPA_NONE, lnum, labels); } + else if (r->dest) + ea_set_dest(&a->eattrs, 0, r->dest); + /* Already announced */ if (r->state == SRS_CLEAN) return; |