diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-23 17:18:56 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-25 04:57:11 -0800 |
commit | d94f5d2c03b8eb265cfa1af5dce43da7194538b8 (patch) | |
tree | 94872abec34c97a19c9abe457b10217d8c44964a /config/util.go | |
parent | 3817b82f9d57ce02adb025f5acff6f06b54c6641 (diff) |
config: add openconfig identity structs in bgp_configs.go
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config/util.go')
-rw-r--r-- | config/util.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config/util.go b/config/util.go index ca2ebe4c..5d543b9c 100644 --- a/config/util.go +++ b/config/util.go @@ -16,6 +16,7 @@ package config import ( + "fmt" "github.com/osrg/gobgp/packet" ) @@ -39,9 +40,9 @@ type AfiSafis []AfiSafi func (c AfiSafis) ToRfList() ([]bgp.RouteFamily, error) { rfs := make([]bgp.RouteFamily, 0, len(c)) for _, rf := range c { - k, err := bgp.GetRouteFamily(rf.AfiSafiName) + k, err := bgp.GetRouteFamily(string(rf.AfiSafiName)) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid address family: %s", rf.AfiSafiName) } rfs = append(rfs, k) } |