From 72163bd5f3ccefc1edda585f6f605c37e774a0b8 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 9 Jan 2018 18:42:22 +0100 Subject: 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. --- proto/bgp/config.Y | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'proto/bgp') 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: -- cgit v1.2.3