From d01c1586b9b1a25965448f9e15a05d94f2b22a5f Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sun, 6 Dec 2015 10:20:09 +0900 Subject: config: use viper and support multiple configuration formats // toml by default $ gobgpd -f gobgpd.toml // use -t to change configuration type $ gobgpd -t yaml -f gobgpd.yaml Signed-off-by: ISHIDA Wataru --- table/policy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'table/policy.go') diff --git a/table/policy.go b/table/policy.go index 52d6900c..7148b764 100644 --- a/table/policy.go +++ b/table/policy.go @@ -515,7 +515,11 @@ func NewNeighborSet(c config.NeighborSet) (*NeighborSet, error) { } list := make([]net.IP, 0, len(c.NeighborInfoList)) for _, x := range c.NeighborInfoList { - list = append(list, x.Address) + addr := net.ParseIP(x.Address) + if addr == nil { + return nil, fmt.Errorf("invalid address: %s", x.Address) + } + list = append(list, addr) } return &NeighborSet{ name: name, -- cgit v1.2.3