From 149f1f2ea90e9d92a5839a45dcd8e533d0055efe Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 25 Feb 2015 21:45:26 +0900 Subject: config: set default config value only when not specified Signed-off-by: FUJITA Tomonori --- config/serve.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'config/serve.go') diff --git a/config/serve.go b/config/serve.go index 02eb2e6e..924dc27d 100644 --- a/config/serve.go +++ b/config/serve.go @@ -10,14 +10,11 @@ func ReadConfigfileServe(path string, configCh chan BgpType, reloadCh chan bool) <-reloadCh b := BgpType{} - _, err := toml.DecodeFile(path, &b) + md, err := toml.DecodeFile(path, &b) if err != nil { - log.Fatal("can't read config file ", path) + log.Fatal("can't read config file ", path, err) } else { - // TODO: validate configuration - for i, _ := range b.NeighborList { - SetNeighborTypeDefault(&b.NeighborList[i]) - } + SetDefaultConfigValues(md, &b) } configCh <- b -- cgit v1.2.3