From cdca8b5ceffd12ff702903e3369f3cafff2787ae Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 9 Aug 2016 16:03:20 +0000 Subject: [PATCH] cli: fix ParseExtendedCommunities() to correctly parse action 'accept' close #1049 Signed-off-by: ISHIDA Wataru --- gobgp/cmd/global.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go index a02de92a..c9bc97d6 100644 --- a/gobgp/cmd/global.go +++ b/gobgp/cmd/global.go @@ -254,9 +254,6 @@ func ParseExtendedCommunities(input string) ([]bgp.ExtendedCommunityInterface, e for i, idx := range idxs { var a []string f := ExtCommParserMap[idx.t] - if f == nil { - continue - } if i < len(idxs)-1 { a = args[:idxs[i+1].i-idx.i] args = args[(idxs[i+1].i - idx.i):] @@ -264,6 +261,9 @@ func ParseExtendedCommunities(input string) ([]bgp.ExtendedCommunityInterface, e a = args args = nil } + if f == nil { + continue + } ext, err := f(a) if err != nil { return nil, err