summaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/table/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/table/path.go')
-rw-r--r--internal/pkg/table/path.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/pkg/table/path.go b/internal/pkg/table/path.go
index b6080ffa..92aec66f 100644
--- a/internal/pkg/table/path.go
+++ b/internal/pkg/table/path.go
@@ -900,6 +900,12 @@ func (path *Path) GetLargeCommunities() []*bgp.LargeCommunity {
}
func (path *Path) SetLargeCommunities(cs []*bgp.LargeCommunity, doReplace bool) {
+ if len(cs) == 0 && doReplace {
+ // clear large communities
+ path.delPathAttr(bgp.BGP_ATTR_TYPE_LARGE_COMMUNITY)
+ return
+ }
+
a := path.getPathAttr(bgp.BGP_ATTR_TYPE_LARGE_COMMUNITY)
if a == nil || doReplace {
path.setPathAttr(bgp.NewPathAttributeLargeCommunities(cs))