diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-04-05 16:16:04 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-04-18 13:56:40 +0200 |
commit | 4278abfe272de64556c4d6df19efc0c853527851 (patch) | |
tree | c5797a702855412fc88c04c9f1a14f73c9c71555 /proto | |
parent | 3484cb9a654cab9bd2c2b1164528d3000a22a79e (diff) |
Check validity of dest w.r.t. net_type
Allow to define static roa/flow routes without dest.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/rpki/rpki.c | 2 | ||||
-rw-r--r-- | proto/static/config.Y | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/proto/rpki/rpki.c b/proto/rpki/rpki.c index 5459d9c3..349d2f70 100644 --- a/proto/rpki/rpki.c +++ b/proto/rpki/rpki.c @@ -903,7 +903,7 @@ rpki_postconfig(struct proto_config *CF) } static void -rpki_copy_config(struct proto_config *dest, struct proto_config *src) +rpki_copy_config(struct proto_config *dest UNUSED, struct proto_config *src UNUSED) { /* FIXME: Should copy transport */ } diff --git a/proto/static/config.Y b/proto/static/config.Y index 6643ba69..66ae3c98 100644 --- a/proto/static/config.Y +++ b/proto/static/config.Y @@ -36,7 +36,10 @@ static_nexthop_new(void) static void static_route_finish(void) -{ } +{ + if (net_type_match(this_srt->net, NB_DEST) == !this_srt->dest) + cf_error("Unexpected or missing nexthop/type"); +} CF_DECLS @@ -119,6 +122,7 @@ stat_route: this_srt->via = $3; this_srt->mls = $5; } + | stat_route0 { this_srt->dest = RTD_NONE; } | stat_route0 DROP { this_srt->dest = RTD_BLACKHOLE; } | stat_route0 REJECT { this_srt->dest = RTD_UNREACHABLE; } | stat_route0 BLACKHOLE { this_srt->dest = RTD_BLACKHOLE; } |