diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-01-09 18:42:22 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-01-09 18:42:22 +0100 |
commit | 72163bd5f3ccefc1edda585f6f605c37e774a0b8 (patch) | |
tree | 59df1629a4c0884e2072c8082e9b4d392be648e4 /proto/bgp/config.Y | |
parent | 09c1e370b3084f7acb7c3777427670a69945368a (diff) |
Nest: Allow modification of channels inherited from templates
Multiple definitions of same channels are forbidden, but inherited
channel can be redefined. In such case channel options are merged.
Diffstat (limited to 'proto/bgp/config.Y')
-rw-r--r-- | proto/bgp/config.Y | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index 6ce0f1aa..4e819eb7 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -158,12 +158,16 @@ bgp_channel_start: bgp_afi if (!desc) cf_error("Unknown AFI/SAFI"); - this_channel = channel_config_new(&channel_bgp, desc->net, this_proto); - BGP_CC->c.name = desc->name; - BGP_CC->c.ra_mode = RA_UNDEF; - BGP_CC->afi = $1; - BGP_CC->desc = desc; - BGP_CC->gr_able = 0xff; /* undefined */ + this_channel = channel_config_get(&channel_bgp, desc->name, desc->net, this_proto); + + /* New channel */ + if (!BGP_CC->desc) + { + BGP_CC->c.ra_mode = RA_UNDEF; + BGP_CC->afi = $1; + BGP_CC->desc = desc; + BGP_CC->gr_able = 0xff; /* undefined */ + } }; bgp_channel_item: |