summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--policy/policy.go5
-rw-r--r--table/path.go4
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 {