summaryrefslogtreecommitdiffhomepage
path: root/config/default.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/default.go')
-rw-r--r--config/default.go17
1 files changed, 17 insertions, 0 deletions
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() {