From c9ec21fe3250551b0e02fa4c7dcf776996aa2af2 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 11 Mar 2015 15:32:39 +0000 Subject: config: add 'Global.AfiSafiList' default value Signed-off-by: FUJITA Tomonori --- config/default.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/config/default.go b/config/default.go index 5820ef01..103a8084 100644 --- a/config/default.go +++ b/config/default.go @@ -17,6 +17,23 @@ type neighbor struct { func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error { neighbors := []neighbor{} + global := make(map[string]bool) + + for _, key := range md.Keys() { + if !strings.HasPrefix(key.String(), "Global") { + continue + } + if key.String() != "Global" { + global[key.String()] = true + } + } + + if _, ok := global["Global.AfiSafiList"]; !ok { + bt.Global.AfiSafiList = []AfiSafi{ + AfiSafi{AfiSafiName: "ipv4-unicast"}, + AfiSafi{AfiSafiName: "ipv6-unicast"}, + } + } nidx := 0 for _, key := range md.Keys() { -- cgit v1.2.3