diff --git a/bird/bird.go b/bird/bird.go index 7b66527..d3fed95 100644 --- a/bird/bird.go +++ b/bird/bird.go @@ -202,12 +202,13 @@ func RoutesNoExport(protocol string) (Parsed, bool) { // In case we have a multi table setup, we have to query // the pipe protocol. - if ParserConf.PerPeerTables && - strings.HasPrefix(protocol, ParserConf.PeerProtocolPrefix) { - + if ParserConf.PerPeerTables { // Replace prefix - protocol = ParserConf.PipeProtocolPrefix + - protocol[len(ParserConf.PeerProtocolPrefix):] + protocol = TemplateExpand( + ParserConf.PipeProtocolMatch, + ParserConf.PipeProtocolTemplate, + protocol, + ) } return RunAndParse("route noexport '"+protocol+"' all", diff --git a/bird/config.go b/bird/config.go index 673cdb1..292ad4c 100644 --- a/bird/config.go +++ b/bird/config.go @@ -18,9 +18,9 @@ type BirdConfig struct { type ParserConfig struct { FilterFields []string `toml:"filter_fields"` - PerPeerTables bool `toml:"per_peer_tables"` - PeerProtocolPrefix string `toml:"peer_protocol_prefix"` - PipeProtocolPrefix string `toml:"pipe_protocol_prefix"` + PerPeerTables bool `toml:"per_peer_tables"` + PeerProtocolMatch string `toml:"peer_protocol_match"` + PipeProtocolTemplate string `toml:"pipe_protocol_template"` } type RateLimitConfig struct {