diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-07-30 18:54:56 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-05 17:24:36 +0900 |
commit | 6b3e4a74e30130909fc6e86a9ce1d5c1b85c95c9 (patch) | |
tree | 34337f2eb9f9c4b224fca7cd8ae86b07642625aa | |
parent | 2017bdc7a9452d4a66dd062016f1b68fbf4ef09b (diff) |
path: return Extendedcommunityinterface rathar than interface{}
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | policy/policy.go | 5 | ||||
-rw-r--r-- | table/path.go | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/policy/policy.go b/policy/policy.go index 2a90f5c6..afe2f1a8 100644 --- a/policy/policy.go +++ b/policy/policy.go @@ -922,7 +922,7 @@ func getECommunityElem(gAdmin string) (bool, bgp.ExtendedCommunityAttrType, inte return false, bgp.ExtendedCommunityAttrType(0xFF), nil } -func (c *ExtCommunityCondition) checkMembers(eCommunities []interface{}, checkAll bool) bool { +func (c *ExtCommunityCondition) checkMembers(eCommunities []bgp.ExtendedCommunityInterface, checkAll bool) bool { result := false if checkAll { @@ -960,8 +960,7 @@ func (c *ExtCommunityCondition) checkMembers(eCommunities []interface{}, checkAl matched := false matchStr := "" for _, member := range c.ExtCommunityList { - for _, eCommunity := range eCommunities { - ec := eCommunity.(bgp.ExtendedCommunityInterface) + for _, ec := range eCommunities { t, st := ec.GetTypes() if member.isRegExp { ecString := fmt.Sprintf("%s:%s", makeTypeSubStr(st), ec.String()) diff --git a/table/path.go b/table/path.go index a3b609e9..4f1ff637 100644 --- a/table/path.go +++ b/table/path.go @@ -456,8 +456,8 @@ func (path *Path) ClearCommunities() { } } -func (path *Path) GetExtCommunities() []interface{} { - eCommunityList := make([]interface{}, 0) +func (path *Path) GetExtCommunities() []bgp.ExtendedCommunityInterface { + eCommunityList := make([]bgp.ExtendedCommunityInterface, 0) if _, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_EXTENDED_COMMUNITIES); attr != nil { eCommunities := attr.(*bgp.PathAttributeExtendedCommunities).Value for _, eCommunity := range eCommunities { |