diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-11-12 04:02:38 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-11-12 04:02:38 +0100 |
commit | 3b56bf8849283977f2f4fa7b8f3dc62fdd8d7587 (patch) | |
tree | 871526fcf88300711a203be912ad18c31701b8ec /nest/config.Y | |
parent | 99ad208dd73d357156672a53f48b77dcf6515c30 (diff) |
BFD: Better handling of BFD options in BGP configs
Merge multiple BFD option blocks in BGP configs instead of using the last
one. That is necessary for proper handling of templates when BFD options
are used both in a BGP template and in a BGP protocol derived from that
template.
Diffstat (limited to 'nest/config.Y')
-rw-r--r-- | nest/config.Y | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/nest/config.Y b/nest/config.Y index 73556f15..83f2c7ba 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -52,6 +52,28 @@ get_passwords(void) return rv; } +static inline void +init_bfd_opts(struct bfd_options **opts) +{ + cf_check_bfd(1); + + if (! *opts) + *opts = bfd_new_options(); +} + +static inline void +open_bfd_opts(struct bfd_options **opts) +{ + init_bfd_opts(opts); + this_bfd_opts = *opts; +} + +static inline void +close_bfd_opts(void) +{ + this_bfd_opts = NULL; +} + static void proto_postconfig(void) { @@ -99,7 +121,6 @@ CF_ENUM_PX(T_ENUM_AF, AF_, AFI_, IPV4, IPV6) %type <ps> proto_patt proto_patt2 %type <cc> channel_start proto_channel %type <cl> limit_spec -%type <bo> bfd_opts %type <net> r_args_for_val %type <net_ptr> r_args_for %type <t> r_args_channel @@ -519,7 +540,7 @@ bfd_items: ; bfd_opts: - '{' { this_bfd_opts = bfd_new_options(); } bfd_items '}' { $$ = this_bfd_opts; this_bfd_opts = NULL; } + '{' bfd_items '}' ; /* Core commands */ |